Migrate llvm::Optional to std::optional

LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
This commit is contained in:
Ben Barham
2024-02-02 22:19:39 -08:00
parent d3d4bd203c
commit ef8825bfe6
810 changed files with 8035 additions and 8718 deletions

View File

@@ -33,7 +33,7 @@ class ASTScriptParser {
ASTContext &Context;
DiagnosticEngine &Diags;
std::unique_ptr<llvm::MemoryBuffer> Buffer;
llvm::Optional<Lexer> TheLexer;
std::optional<Lexer> TheLexer;
Token Tok;
public:
@@ -94,10 +94,10 @@ private:
return true;
}
llvm::Optional<StringRef> consumeIfIdentifier() {
std::optional<StringRef> consumeIfIdentifier() {
StringRef ident;
return consumeIfIdentifier(ident) ? llvm::Optional<StringRef>(ident)
: llvm::None;
return consumeIfIdentifier(ident) ? std::optional<StringRef>(ident)
: std::nullopt;
}
/***************************************************************************/