summaryrefslogtreecommitdiffstats
path: root/clang/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
commit1bf5846abf2ce98c4c9c420d1757b01a1663d8cc (patch)
tree2dcbb6372072983963df0b5d6bf58a31bdf103d0 /clang/lib/AST/Expr.cpp
parentc8fb2557b9e96fcde75d8cb4a5bf6de06e1ea470 (diff)
downloadbcm5719-llvm-1bf5846abf2ce98c4c9c420d1757b01a1663d8cc.tar.gz
bcm5719-llvm-1bf5846abf2ce98c4c9c420d1757b01a1663d8cc.zip
Save a copy expression for non-trivial copy constructions of catch variables.
llvm-svn: 125661
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 884a184b526..209e5d3260f 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/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.
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud