diff options
author | Kazu Hirata <kazu@google.com> | 2023-01-14 12:31:01 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-01-14 12:31:01 -0800 |
commit | 6ad0788c332bb2043142954d300c49ac3e537f34 (patch) | |
tree | a67542ce4ca8dbcc65ef3cd01e76ff9cb861208b /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | ff39b7ea89476c78177aff5cb0ddb441e74c8838 (diff) | |
download | llvm-6ad0788c332bb2043142954d300c49ac3e537f34.zip llvm-6ad0788c332bb2043142954d300c49ac3e537f34.tar.gz llvm-6ad0788c332bb2043142954d300c49ac3e537f34.tar.bz2 |
[clang] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 083d6b6..2b21926 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -423,7 +423,8 @@ namespace clang { bool &BadDebugInfo, StringRef &Filename, unsigned &Line, unsigned &Column) const; - Optional<FullSourceLoc> getFunctionSourceLocation(const Function &F) const; + std::optional<FullSourceLoc> + getFunctionSourceLocation(const Function &F) const; void DiagnosticHandlerImpl(const llvm::DiagnosticInfo &DI); /// Specialized handler for InlineAsm diagnostic. @@ -692,7 +693,7 @@ const FullSourceLoc BackendConsumer::getBestLocationFromDebugLoc( return Loc; } -Optional<FullSourceLoc> +std::optional<FullSourceLoc> BackendConsumer::getFunctionSourceLocation(const Function &F) const { auto Hash = llvm::hash_value(F.getName()); for (const auto &Pair : ManglingFullSourceLocs) { @@ -1183,7 +1184,7 @@ void CodeGenAction::ExecuteAction() { SourceManager &SM = CI.getSourceManager(); FileID FID = SM.getMainFileID(); - Optional<MemoryBufferRef> MainFile = SM.getBufferOrNone(FID); + std::optional<MemoryBufferRef> MainFile = SM.getBufferOrNone(FID); if (!MainFile) return; |