diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-23 00:29:34 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-23 00:29:34 +0000 |
commit | b07805485c603be3d8011f72611465324c9e664b (patch) | |
tree | 2a1bf633a0201b748631fb8fa90fa7c2280990cc /lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | |
parent | 02fb50d54042982bccc04c276ad2342827c8fcd3 (diff) |
Remove the CFGElement "Invalid" state.
Use Optional<CFG*> where invalid states were needed previously. In the one case
where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy
CFGAutomaticObjDtor.
Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek
and Doug Gregor.
Post commit code review feedback on r175796 by Ted Kremenek.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngineCXX.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp index 5d04340a97..e7d59ebf57 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp @@ -90,8 +90,8 @@ void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *CE, CFGElement Next = (*B)[currStmtIdx+1]; // Is this a constructor for a local variable? - if (CFGStmt StmtElem = Next.getAs<CFGStmt>()) { - if (const DeclStmt *DS = dyn_cast<DeclStmt>(StmtElem.getStmt())) { + if (Optional<CFGStmt> StmtElem = Next.getAs<CFGStmt>()) { + if (const DeclStmt *DS = dyn_cast<DeclStmt>(StmtElem->getStmt())) { if (const VarDecl *Var = dyn_cast<VarDecl>(DS->getSingleDecl())) { if (Var->getInit()->IgnoreImplicit() == CE) { QualType Ty = Var->getType(); @@ -113,8 +113,8 @@ void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *CE, } // Is this a constructor for a member? - if (CFGInitializer InitElem = Next.getAs<CFGInitializer>()) { - const CXXCtorInitializer *Init = InitElem.getInitializer(); + if (Optional<CFGInitializer> InitElem = Next.getAs<CFGInitializer>()) { + const CXXCtorInitializer *Init = InitElem->getInitializer(); assert(Init->isAnyMemberInitializer()); const CXXMethodDecl *CurCtor = cast<CXXMethodDecl>(LCtx->getDecl()); |