summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/Consumed.cpp
diff options
context:
space:
mode:
authorTim Shen <timshen91@gmail.com>2016-06-09 19:54:46 +0000
committerTim Shen <timshen91@gmail.com>2016-06-09 19:54:46 +0000
commitf120a7b6a31ae73e0d59f58e6f1dd72318a72525 (patch)
tree10a5b92b5f5a301c4d0f4c71ad29e67856b40fdd /clang/lib/Analysis/Consumed.cpp
parent17b4701070e068eebdb1927130feb0eed1273980 (diff)
downloadbcm5719-llvm-f120a7b6a31ae73e0d59f58e6f1dd72318a72525.tar.gz
bcm5719-llvm-f120a7b6a31ae73e0d59f58e6f1dd72318a72525.zip
[Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr.
These ExprWithCleanups are added for holding a RunCleanupsScope not for destructor calls; rather, they are for lifetime marks. This requires ExprWithCleanups to keep a bit to indicate whether it have cleanups with side effects (e.g. dtor calls). Differential Revision: http://reviews.llvm.org/D20498 llvm-svn: 272296
Diffstat (limited to 'clang/lib/Analysis/Consumed.cpp')
-rw-r--r--clang/lib/Analysis/Consumed.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Analysis/Consumed.cpp b/clang/lib/Analysis/Consumed.cpp
index 9df23923b01..f2a7d904a54 100644
--- a/clang/lib/Analysis/Consumed.cpp
+++ b/clang/lib/Analysis/Consumed.cpp
@@ -466,9 +466,15 @@ class ConsumedStmtVisitor : public ConstStmtVisitor<ConsumedStmtVisitor> {
MapType PropagationMap;
InfoEntry findInfo(const Expr *E) {
+ if (auto Cleanups = dyn_cast<ExprWithCleanups>(E))
+ if (!Cleanups->cleanupsHaveSideEffects())
+ E = Cleanups->getSubExpr();
return PropagationMap.find(E->IgnoreParens());
}
ConstInfoEntry findInfo(const Expr *E) const {
+ if (auto Cleanups = dyn_cast<ExprWithCleanups>(E))
+ if (!Cleanups->cleanupsHaveSideEffects())
+ E = Cleanups->getSubExpr();
return PropagationMap.find(E->IgnoreParens());
}
void insertInfo(const Expr *E, const PropagationInfo &PI) {
OpenPOWER on IntegriCloud