diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-04-14 21:41:27 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-06-22 18:20:56 +0000 |
| commit | bdd1243df58e60e85101c09001d9812a789b6bc4 (patch) | |
| tree | a1ce621c7301dd47ba2ddc3b8eaa63b441389481 /contrib/llvm-project/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp | |
| parent | 781624ca2d054430052c828ba8d2c2eaf2d733e7 (diff) | |
| parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) | |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/contrib/llvm-project/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp b/contrib/llvm-project/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp index 5a77a25b1569..b2627196bce6 100644 --- a/contrib/llvm-project/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp +++ b/contrib/llvm-project/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp @@ -13,6 +13,7 @@ #include "llvm/Remarks/BitstreamRemarkSerializer.h" #include "llvm/Remarks/Remark.h" +#include <optional> using namespace llvm; using namespace llvm::remarks; @@ -231,8 +232,9 @@ void BitstreamRemarkSerializerHelper::setupBlockInfo() { } void BitstreamRemarkSerializerHelper::emitMetaBlock( - uint64_t ContainerVersion, Optional<uint64_t> RemarkVersion, - Optional<const StringTable *> StrTab, Optional<StringRef> Filename) { + uint64_t ContainerVersion, std::optional<uint64_t> RemarkVersion, + std::optional<const StringTable *> StrTab, + std::optional<StringRef> Filename) { // Emit the meta block Bitstream.EnterSubblock(META_BLOCK_ID, 3); @@ -245,19 +247,19 @@ void BitstreamRemarkSerializerHelper::emitMetaBlock( switch (ContainerType) { case BitstreamRemarkContainerType::SeparateRemarksMeta: - assert(StrTab != None && *StrTab != nullptr); + assert(StrTab != std::nullopt && *StrTab != nullptr); emitMetaStrTab(**StrTab); - assert(Filename != None); + assert(Filename != std::nullopt); emitMetaExternalFile(*Filename); break; case BitstreamRemarkContainerType::SeparateRemarksFile: - assert(RemarkVersion != None); + assert(RemarkVersion != std::nullopt); emitMetaRemarkVersion(*RemarkVersion); break; case BitstreamRemarkContainerType::Standalone: - assert(RemarkVersion != None); + assert(RemarkVersion != std::nullopt); emitMetaRemarkVersion(*RemarkVersion); - assert(StrTab != None && *StrTab != nullptr); + assert(StrTab != std::nullopt && *StrTab != nullptr); emitMetaStrTab(**StrTab); break; } @@ -277,7 +279,7 @@ void BitstreamRemarkSerializerHelper::emitRemarkBlock(const Remark &Remark, R.push_back(StrTab.add(Remark.FunctionName).first); Bitstream.EmitRecordWithAbbrev(RecordRemarkHeaderAbbrevID, R); - if (const Optional<RemarkLocation> &Loc = Remark.Loc) { + if (const std::optional<RemarkLocation> &Loc = Remark.Loc) { R.clear(); R.push_back(RECORD_REMARK_DEBUG_LOC); R.push_back(StrTab.add(Loc->SourceFilePath).first); @@ -286,7 +288,7 @@ void BitstreamRemarkSerializerHelper::emitRemarkBlock(const Remark &Remark, Bitstream.EmitRecordWithAbbrev(RecordRemarkDebugLocAbbrevID, R); } - if (Optional<uint64_t> Hotness = Remark.Hotness) { + if (std::optional<uint64_t> Hotness = Remark.Hotness) { R.clear(); R.push_back(RECORD_REMARK_HOTNESS); R.push_back(*Hotness); @@ -297,7 +299,7 @@ void BitstreamRemarkSerializerHelper::emitRemarkBlock(const Remark &Remark, R.clear(); unsigned Key = StrTab.add(Arg.Key).first; unsigned Val = StrTab.add(Arg.Val).first; - bool HasDebugLoc = Arg.Loc != None; + bool HasDebugLoc = Arg.Loc != std::nullopt; R.push_back(HasDebugLoc ? RECORD_REMARK_ARG_WITH_DEBUGLOC : RECORD_REMARK_ARG_WITHOUT_DEBUGLOC); R.push_back(Key); @@ -353,7 +355,8 @@ void BitstreamRemarkSerializer::emit(const Remark &Remark) { Helper.ContainerType == BitstreamRemarkContainerType::Standalone; BitstreamMetaSerializer MetaSerializer( OS, Helper, - IsStandalone ? &*StrTab : Optional<const StringTable *>(None)); + IsStandalone ? &*StrTab + : std::optional<const StringTable *>(std::nullopt)); MetaSerializer.emit(); DidSetUp = true; } @@ -366,7 +369,7 @@ void BitstreamRemarkSerializer::emit(const Remark &Remark) { } std::unique_ptr<MetaSerializer> BitstreamRemarkSerializer::metaSerializer( - raw_ostream &OS, Optional<StringRef> ExternalFilename) { + raw_ostream &OS, std::optional<StringRef> ExternalFilename) { assert(Helper.ContainerType != BitstreamRemarkContainerType::SeparateRemarksMeta); bool IsStandalone = |
