aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-16 08:02:54 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-16 08:02:54 +0000
commite996ffd240f20a1048179d7727a6ee3227261921 (patch)
tree4401959697b60e22969148b60cd09e9b343fec14 /lib/AST/Expr.cpp
parentc515d18023e952357d5dee645e6e3539b7b3d992 (diff)
Save a copy expression for non-trivial copy constructions of catch variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 884a184b52..209e5d3260 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -2751,6 +2751,15 @@ ParenListExpr::ParenListExpr(ASTContext& C, SourceLocation lparenloc,
}
}
+const OpaqueValueExpr *OpaqueValueExpr::findInCopyConstruct(const Expr *e) {
+ if (const ExprWithCleanups *ewc = dyn_cast<ExprWithCleanups>(e))
+ e = ewc->getSubExpr();
+ e = cast<CXXConstructExpr>(e)->getArg(0);
+ while (const ImplicitCastExpr *ice = dyn_cast<ImplicitCastExpr>(e))
+ e = ice->getSubExpr();
+ return cast<OpaqueValueExpr>(e);
+}
+
//===----------------------------------------------------------------------===//
// ExprIterator.
//===----------------------------------------------------------------------===//