From 77212133072dc40f070a280af8217032f55a9eb4 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Tue, 15 Dec 2009 18:49:47 +0000 Subject: Update clang to 91430. --- lib/Analysis/CheckDeadStores.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Analysis/CheckDeadStores.cpp') diff --git a/lib/Analysis/CheckDeadStores.cpp b/lib/Analysis/CheckDeadStores.cpp index ad63eb4..db9016f 100644 --- a/lib/Analysis/CheckDeadStores.cpp +++ b/lib/Analysis/CheckDeadStores.cpp @@ -84,7 +84,8 @@ public: const LiveVariables::AnalysisDataTy& AD, const LiveVariables::ValTy& Live) { - if (VD->hasLocalStorage() && !Live(VD, AD) && !VD->getAttr()) + if (VD->hasLocalStorage() && !Live(VD, AD) && + !(VD->getAttr() || VD->getAttr())) Report(VD, dsk, Ex->getSourceRange().getBegin(), Val->getSourceRange()); } @@ -185,6 +186,10 @@ public: if (V->hasLocalStorage()) if (Expr* E = V->getInit()) { + // Don't warn on C++ objects (yet) until we can show that their + // constructors/destructors don't have side effects. + if (isa(E)) + return; // A dead initialization is a variable that is dead after it // is initialized. We don't flag warnings for those variables // marked 'unused'. -- cgit v1.1