diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-12-03 00:46:16 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-12-03 00:46:16 +0000 |
| commit | f66b72094a9d537a2ec15e6c4d2871b8f58c9aea (patch) | |
| tree | a25b1c7ac14456971f76b1d307cc4e79c0087c58 /clang/lib/Analysis/CheckDeadStores.cpp | |
| parent | 1ed59c63e3ad386ad4b2dca16153ad9e8f4dfa51 (diff) | |
| download | bcm5719-llvm-f66b72094a9d537a2ec15e6c4d2871b8f58c9aea.tar.gz bcm5719-llvm-f66b72094a9d537a2ec15e6c4d2871b8f58c9aea.zip | |
Add a heuristic to the dead stores checker to prune dead stores for variables annotated with '__block'. This is overly conservative, but now the analyzer doesn't report dead stores for variables that can be updated by a block call.
llvm-svn: 90364
Diffstat (limited to 'clang/lib/Analysis/CheckDeadStores.cpp')
| -rw-r--r-- | clang/lib/Analysis/CheckDeadStores.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CheckDeadStores.cpp b/clang/lib/Analysis/CheckDeadStores.cpp index ad63eb4122b..ec13328447a 100644 --- a/clang/lib/Analysis/CheckDeadStores.cpp +++ b/clang/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<UnusedAttr>()) + if (VD->hasLocalStorage() && !Live(VD, AD) && + !(VD->getAttr<UnusedAttr>() || VD->getAttr<BlocksAttr>())) Report(VD, dsk, Ex->getSourceRange().getBegin(), Val->getSourceRange()); } |

