diff --git a/clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp b/clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp index b112059693e85a..2bdb1cdcc95343 100644 --- a/clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp +++ b/clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp @@ -36,7 +36,7 @@ buildStmtToBasicBlockMap(const CFG &Cfg) { if (!Stmt) continue; - StmtToBlock[Stmt.value().getStmt()] = Block; + StmtToBlock[Stmt->getStmt()] = Block; } if (const Stmt *TerminatorStmt = Block->getTerminatorStmt()) StmtToBlock[TerminatorStmt] = Block; diff --git a/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp b/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp index 1e3ecf46e31120..d4886f154b339f 100644 --- a/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp +++ b/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp @@ -185,7 +185,7 @@ Constraints auto StatusString = clang::dataflow::debugString(Result.getStatus()); auto Solution = Result.getSolution(); - auto SolutionString = Solution ? "\n" + debugString(Solution.value()) : ""; + auto SolutionString = Solution ? "\n" + debugString(*Solution) : ""; return formatv( Template, diff --git a/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp b/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp index 5c885680207d72..ced016f1be035e 100644 --- a/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp +++ b/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp @@ -262,7 +262,7 @@ computeBlockInputState(const CFGBlock &Block, AnalysisContext &AC) { if (!MaybePredState) continue; - TypeErasedDataflowAnalysisState PredState = MaybePredState.value(); + TypeErasedDataflowAnalysisState PredState = *MaybePredState; if (BuiltinTransferOpts) { if (const Stmt *PredTerminatorStmt = Pred->getTerminatorStmt()) { const StmtToEnvMapImpl StmtToEnv(AC.CFCtx, AC.BlockStates); diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index f99275e4f243cb..9958671e03a180 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -538,7 +538,7 @@ bool CursorVisitor::VisitChildren(CXCursor Cursor) { const Optional V = handleDeclForVisitation(*TL); if (!V) continue; - return V.value(); + return *V; } } else if (VisitDeclContext( CXXUnit->getASTContext().getTranslationUnitDecl())) @@ -643,7 +643,7 @@ bool CursorVisitor::VisitDeclContext(DeclContext *DC) { const Optional V = handleDeclForVisitation(D); if (!V) continue; - return V.value(); + return *V; } return false; } @@ -677,7 +677,7 @@ Optional CursorVisitor::handleDeclForVisitation(const Decl *D) { const Optional V = shouldVisitCursor(Cursor); if (!V) return std::nullopt; - if (!V.value()) + if (!*V) return false; if (Visit(Cursor, true)) return true; @@ -1076,7 +1076,7 @@ bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) { const Optional &V = shouldVisitCursor(Cursor); if (!V) continue; - if (!V.value()) + if (!*V) return false; if (Visit(Cursor, true)) return true; diff --git a/clang/unittests/Lex/HeaderSearchTest.cpp b/clang/unittests/Lex/HeaderSearchTest.cpp index e67445f1aeadcd..b0f4221ad335b0 100644 --- a/clang/unittests/Lex/HeaderSearchTest.cpp +++ b/clang/unittests/Lex/HeaderSearchTest.cpp @@ -214,7 +214,7 @@ TEST_F(HeaderSearchTest, HeaderFrameworkLookup) { EXPECT_TRUE(FoundFile.has_value()); EXPECT_TRUE(IsFrameworkFound); - auto &FE = FoundFile.value(); + auto &FE = *FoundFile; auto FI = Search.getExistingFileInfo(FE); EXPECT_TRUE(FI); EXPECT_TRUE(FI->IsValid); @@ -284,7 +284,7 @@ TEST_F(HeaderSearchTest, HeaderMapFrameworkLookup) { EXPECT_TRUE(FoundFile.has_value()); EXPECT_TRUE(IsMapped); - auto &FE = FoundFile.value(); + auto &FE = *FoundFile; auto FI = Search.getExistingFileInfo(FE); EXPECT_TRUE(FI); EXPECT_TRUE(FI->IsValid);