[Utils] Use std::optional in Local.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 01:49:07 +0000 (17:49 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 01:49:07 +0000 (17:49 -0800)
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

llvm/lib/Transforms/Utils/Local.cpp

index 2e0b4b0..82501cd 100644 (file)
@@ -80,6 +80,7 @@
 #include <cstdint>
 #include <iterator>
 #include <map>
+#include <optional>
 #include <utility>
 
 using namespace llvm;
@@ -2048,7 +2049,7 @@ Value *llvm::salvageDebugInfoImpl(Instruction &I, uint64_t CurrentLocOps,
 }
 
 /// A replacement for a dbg.value expression.
-using DbgValReplacement = Optional<DIExpression *>;
+using DbgValReplacement = std::optional<DIExpression *>;
 
 /// Point debug users of \p From to \p To using exprs given by \p RewriteExpr,
 /// possibly moving/undefing users to prevent use-before-def. Returns true if