[cfe-commits] r57189 - /cfe/trunk/lib/Analysis/BugReporter.cpp
Ted Kremenek
kremenek at apple.com
Mon Oct 6 11:37:47 PDT 2008
Author: kremenek
Date: Mon Oct 6 13:37:46 2008
New Revision: 57189
URL: http://llvm.org/viewvc/llvm-project?rev=57189&view=rev
Log:
Use DeclStmt::decl_iterator instead of using Decl::getDecl(). Soon DeclStmts will wrap group of Decls.
Added FIXME.
Modified:
cfe/trunk/lib/Analysis/BugReporter.cpp
Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=57189&r1=57188&r2=57189&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Mon Oct 6 13:37:46 2008
@@ -379,8 +379,12 @@
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;
More information about the cfe-commits
mailing list