diff options
Diffstat (limited to 'clang/lib/Analysis/AnalysisDeclContext.cpp')
-rw-r--r-- | clang/lib/Analysis/AnalysisDeclContext.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Analysis/AnalysisDeclContext.cpp b/clang/lib/Analysis/AnalysisDeclContext.cpp index f20924604f64..d3a1a993711f 100644 --- a/clang/lib/Analysis/AnalysisDeclContext.cpp +++ b/clang/lib/Analysis/AnalysisDeclContext.cpp @@ -142,7 +142,7 @@ bool AnalysisDeclContext::isBodyAutosynthesizedFromModelFile() const { /// Returns true if \param VD is an Objective-C implicit 'self' parameter. static bool isSelfDecl(const VarDecl *VD) { - return isa<ImplicitParamDecl>(VD) && VD->getName() == "self"; + return isa_and_nonnull<ImplicitParamDecl>(VD) && VD->getName() == "self"; } const ImplicitParamDecl *AnalysisDeclContext::getSelfDecl() const { @@ -169,8 +169,8 @@ const ImplicitParamDecl *AnalysisDeclContext::getSelfDecl() const { if (!LC.capturesVariable()) continue; - VarDecl *VD = LC.getCapturedVar(); - if (isSelfDecl(VD)) + ValueDecl *VD = LC.getCapturedVar(); + if (isSelfDecl(dyn_cast<VarDecl>(VD))) return dyn_cast<ImplicitParamDecl>(VD); } @@ -231,8 +231,7 @@ CFG *AnalysisDeclContext::getCFG() { CFG *AnalysisDeclContext::getUnoptimizedCFG() { if (!builtCompleteCFG) { - SaveAndRestore<bool> NotPrune(cfgBuildOptions.PruneTriviallyFalseEdges, - false); + SaveAndRestore NotPrune(cfgBuildOptions.PruneTriviallyFalseEdges, false); completeCFG = CFG::buildCFG(D, getBody(), &D->getASTContext(), cfgBuildOptions); // Even when the cfg is not successfully built, we don't |