From f21a4b4e285eefbe7d7bffe58f515b34b7a4cc2e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 6 Oct 2008 18:37:46 +0000 Subject: [PATCH] Use DeclStmt::decl_iterator instead of using Decl::getDecl(). Soon DeclStmts will wrap group of Decls. Added FIXME. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57189 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/BugReporter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index e56da7b872..834567136f 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/lib/Analysis/BugReporter.cpp @@ -379,8 +379,12 @@ public: VD = dyn_cast(DR->getDecl()); } - else if (DeclStmt* DS = dyn_cast(S)) - VD = dyn_cast(DS->getDecl()); + else if (DeclStmt* DS = dyn_cast(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(*DS->decl_begin()); + } if (!VD) return true; -- 2.40.0