From f120a7b6a31ae73e0d59f58e6f1dd72318a72525 Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Thu, 9 Jun 2016 19:54:46 +0000 Subject: [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 --- clang/lib/Analysis/Consumed.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/Analysis/Consumed.cpp') 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 { MapType PropagationMap; InfoEntry findInfo(const Expr *E) { + if (auto Cleanups = dyn_cast(E)) + if (!Cleanups->cleanupsHaveSideEffects()) + E = Cleanups->getSubExpr(); return PropagationMap.find(E->IgnoreParens()); } ConstInfoEntry findInfo(const Expr *E) const { + if (auto Cleanups = dyn_cast(E)) + if (!Cleanups->cleanupsHaveSideEffects()) + E = Cleanups->getSubExpr(); return PropagationMap.find(E->IgnoreParens()); } void insertInfo(const Expr *E, const PropagationInfo &PI) { -- cgit v1.2.1