[ProfileData] Use std::optional in MemProf.h (NFC)
authorKazu Hirata <kazu@google.com>
Mon, 28 Nov 2022 02:24:39 +0000 (18:24 -0800)
committerKazu Hirata <kazu@google.com>
Mon, 28 Nov 2022 02:24:39 +0000 (18:24 -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/include/llvm/ProfileData/MemProf.h

index bcee3b2..d0ba5b1 100644 (file)
@@ -11,6 +11,7 @@
 #include "llvm/Support/raw_ostream.h"
 
 #include <cstdint>
+#include <optional>
 
 namespace llvm {
 namespace memprof {
@@ -144,7 +145,7 @@ struct Frame {
   GlobalValue::GUID Function;
   // The symbol name for the function. Only populated in the Frame by the reader
   // if requested during initialization. This field should not be serialized.
-  llvm::Optional<std::string> SymbolName;
+  std::optional<std::string> SymbolName;
   // The source line offset of the call from the beginning of parent function.
   uint32_t LineOffset;
   // The source column number of the call to help distinguish multiple calls