diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-10-06 18:37:46 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-10-06 18:37:46 +0000 |
commit | fae8cb0736c9282d1a40d4f7ef6af7cba7793244 (patch) | |
tree | 4d17f1d199e5d36ca6b6939b6c39baee4e09614b /clang/lib/Analysis/BugReporter.cpp | |
parent | 153d967d14bc373002a7515f28438296d150c2b9 (diff) | |
download | bcm5719-llvm-fae8cb0736c9282d1a40d4f7ef6af7cba7793244.tar.gz bcm5719-llvm-fae8cb0736c9282d1a40d4f7ef6af7cba7793244.zip |
Use DeclStmt::decl_iterator instead of using Decl::getDecl(). Soon DeclStmts will wrap group of Decls.
Added FIXME.
llvm-svn: 57189
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r-- | clang/lib/Analysis/BugReporter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp index e56da7b872d..834567136f4 100644 --- a/clang/lib/Analysis/BugReporter.cpp +++ b/clang/lib/Analysis/BugReporter.cpp @@ -379,8 +379,12 @@ public: VD = dyn_cast<VarDecl>(DR->getDecl()); } - else if (DeclStmt* DS = dyn_cast<DeclStmt>(S)) - VD = dyn_cast<VarDecl>(DS->getDecl()); + else if (DeclStmt* DS = dyn_cast<DeclStmt>(S)) { + // FIXME: Eventually CFGs won't have DeclStmts. Right now we + // assume that each DeclStmt has a single Decl. This invariant + // holds by contruction in the CFG. + VD = dyn_cast<VarDecl>(*DS->decl_begin()); + } if (!VD) return true; |