]> granicus.if.org Git - clang/commitdiff
Use DeclStmt::decl_iterator instead of using Decl::getDecl(). Soon DeclStmts will...
authorTed Kremenek <kremenek@apple.com>
Mon, 6 Oct 2008 18:37:46 +0000 (18:37 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 6 Oct 2008 18:37:46 +0000 (18:37 +0000)
Added FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57189 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BugReporter.cpp

index e56da7b872d68b25cde380c24f0fd338c14c3177..834567136f46654d969e432116dcf9e79012c6fa 100644 (file)
@@ -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;