diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-02-11 12:38:04 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-02-11 12:38:11 +0000 |
commit | e3b557809604d036af6e00c60f012c2025b59a5e (patch) | |
tree | 8a11ba2269a3b669601e2fd41145b174008f4da8 /clang/lib/Analysis/AnalysisDeclContext.cpp | |
parent | 08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (diff) |
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 |