diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-12-15 04:12:12 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-12-15 04:12:12 +0000 |
commit | 43f19e3136a9610eeba3cdef9f9af70d93df2f7e (patch) | |
tree | 32bc0b7df4e25379dbf557a3561d3e4283323b9c /lib/Analysis/CheckDeadStores.cpp | |
parent | ea5ae3170d8022c2007295ec794bdaf63f0273a1 (diff) |
Until we can make the dead stores checker smarter, dont' emit dead store warnings for C++ objects (whose constructors/destructors have possible side-effects).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CheckDeadStores.cpp')
-rw-r--r-- | lib/Analysis/CheckDeadStores.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/CheckDeadStores.cpp b/lib/Analysis/CheckDeadStores.cpp index ec13328447..db9016fa1e 100644 --- a/lib/Analysis/CheckDeadStores.cpp +++ b/lib/Analysis/CheckDeadStores.cpp @@ -186,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<CXXConstructExpr>(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'. |