From ebd3eef0b2b0255e4cf1cd825019ff66d3cd1426 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 9 Dec 2022 23:22:41 -0800 Subject: [PATCH] [Frontend] Use std::optional in TextDiagnostic.cpp (NFC) This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 --- clang/lib/Frontend/TextDiagnostic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp index 52129aa..809d530 100644 --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/lib/Frontend/TextDiagnostic.cpp @@ -20,6 +20,7 @@ #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #include +#include using namespace clang; @@ -923,7 +924,7 @@ void TextDiagnostic::emitBuildingModuleLocation(FullSourceLoc Loc, } /// Find the suitable set of lines to show to include a set of ranges. -static llvm::Optional> +static std::optional> findLinesForRange(const CharSourceRange &R, FileID FID, const SourceManager &SM) { if (!R.isValid()) -- 2.7.4