From 3a39b0ac1a72a2fb554e2ccc286003da5166faeb Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Fri, 23 Dec 2022 14:26:34 +0100 Subject: [PATCH] [clang] Migrate away from a deprecated Clang CFG factory function Reviewed By: merrymeerkat Differential Revision: https://reviews.llvm.org/D140620 --- clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp | 2 +- .../unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp index c97917e..ccf9365 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp @@ -43,7 +43,7 @@ analyzeFunction(const FunctionDecl &FuncDecl, ASTContext &ASTCtx, using llvm::Expected; Expected Context = - ControlFlowContext::build(&FuncDecl, FuncDecl.getBody(), &ASTCtx); + ControlFlowContext::build(&FuncDecl, *FuncDecl.getBody(), ASTCtx); if (!Context) return std::nullopt; diff --git a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp index 8e0e27e..31d5117 100644 --- a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp +++ b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp @@ -68,7 +68,7 @@ runAnalysis(llvm::StringRef Code, AnalysisT (*MakeAnalysis)(ASTContext &)) { assert(Body != nullptr); auto CFCtx = llvm::cantFail( - ControlFlowContext::build(nullptr, Body, &AST->getASTContext())); + ControlFlowContext::build(nullptr, *Body, AST->getASTContext())); AnalysisT Analysis = MakeAnalysis(AST->getASTContext()); DataflowAnalysisContext DACtx(std::make_unique()); -- 2.7.4