diff options
author | Kazu Hirata <kazu@google.com> | 2022-11-25 21:18:04 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-11-25 21:18:04 -0800 |
commit | 72e8d03fe9ef5ce8327f9e9c4e2c7d8ddcdc9d11 (patch) | |
tree | 84d4ce2df6b8ae4874a24f89283f33985518e0ea /llvm/lib/Remarks | |
parent | f17dbb9706a2a7ed89ed7877706264060fb28f14 (diff) | |
download | llvm-72e8d03fe9ef5ce8327f9e9c4e2c7d8ddcdc9d11.zip llvm-72e8d03fe9ef5ce8327f9e9c4e2c7d8ddcdc9d11.tar.gz llvm-72e8d03fe9ef5ce8327f9e9c4e2c7d8ddcdc9d11.tar.bz2 |
[Remarks] Use std::optional in YAMLRemarkSerializer.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
Diffstat (limited to 'llvm/lib/Remarks')
-rw-r--r-- | llvm/lib/Remarks/YAMLRemarkSerializer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Remarks/YAMLRemarkSerializer.cpp b/llvm/lib/Remarks/YAMLRemarkSerializer.cpp index fff2b65..a9390d8 100644 --- a/llvm/lib/Remarks/YAMLRemarkSerializer.cpp +++ b/llvm/lib/Remarks/YAMLRemarkSerializer.cpp @@ -14,6 +14,7 @@ #include "llvm/Remarks/YAMLRemarkSerializer.h" #include "llvm/Remarks/Remark.h" #include "llvm/Support/FileSystem.h" +#include <optional> using namespace llvm; using namespace llvm::remarks; @@ -216,7 +217,8 @@ static void emitVersion(raw_ostream &OS) { OS.write(Version.data(), Version.size()); } -static void emitStrTab(raw_ostream &OS, Optional<const StringTable *> StrTab) { +static void emitStrTab(raw_ostream &OS, + std::optional<const StringTable *> StrTab) { // Emit the string table in the section. uint64_t StrTabSize = StrTab ? (*StrTab)->SerializedSize : 0; // Emit the total size of the string table (the size itself excluded): |