From a81a0c97f1a0016686fdc5c5d10644fa2628b376 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Tue, 6 Dec 2022 19:51:30 -0600 Subject: [Remarks] Convert Optional to std::optional --- llvm/include/llvm/Remarks/BitstreamRemarkParser.h | 40 +++++++++++----------- .../llvm/Remarks/BitstreamRemarkSerializer.h | 24 ++++++------- llvm/include/llvm/Remarks/RemarkLinker.h | 10 +++--- llvm/include/llvm/Remarks/RemarkParser.h | 5 +-- llvm/include/llvm/Remarks/RemarkStreamer.h | 12 +++---- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 +- llvm/lib/Remarks/BitstreamRemarkParser.cpp | 14 ++++---- llvm/lib/Remarks/BitstreamRemarkParser.h | 10 +++--- llvm/lib/Remarks/BitstreamRemarkSerializer.cpp | 8 +++-- llvm/lib/Remarks/RemarkLinker.cpp | 18 +++++----- llvm/lib/Remarks/RemarkParser.cpp | 4 +-- llvm/lib/Remarks/RemarkStreamer.cpp | 5 +-- llvm/lib/Remarks/YAMLRemarkParser.cpp | 9 +++-- llvm/lib/Remarks/YAMLRemarkParser.h | 10 +++--- llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp | 3 +- 15 files changed, 91 insertions(+), 83 deletions(-) (limited to 'llvm') diff --git a/llvm/include/llvm/Remarks/BitstreamRemarkParser.h b/llvm/include/llvm/Remarks/BitstreamRemarkParser.h index 6df82c5..bfa6033 100644 --- a/llvm/include/llvm/Remarks/BitstreamRemarkParser.h +++ b/llvm/include/llvm/Remarks/BitstreamRemarkParser.h @@ -15,12 +15,12 @@ #define LLVM_REMARKS_BITSTREAMREMARKPARSER_H #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" #include "llvm/Bitstream/BitstreamReader.h" #include "llvm/Support/Error.h" #include #include +#include namespace llvm { namespace remarks { @@ -33,11 +33,11 @@ struct BitstreamMetaParserHelper { BitstreamBlockInfo &BlockInfo; /// The parsed content: depending on the container type, some fields might be /// empty. - Optional ContainerVersion; - Optional ContainerType; - Optional StrTabBuf; - Optional ExternalFilePath; - Optional RemarkVersion; + std::optional ContainerVersion; + std::optional ContainerType; + std::optional StrTabBuf; + std::optional ExternalFilePath; + std::optional RemarkVersion; /// Continue parsing with \p Stream. \p Stream is expected to contain a /// ENTER_SUBBLOCK to the META_BLOCK at the current position. @@ -55,22 +55,22 @@ struct BitstreamRemarkParserHelper { /// The Bitstream reader. BitstreamCursor &Stream; /// The parsed content: depending on the remark, some fields might be empty. - Optional Type; - Optional RemarkNameIdx; - Optional PassNameIdx; - Optional FunctionNameIdx; - Optional SourceFileNameIdx; - Optional SourceLine; - Optional SourceColumn; - Optional Hotness; + std::optional Type; + std::optional RemarkNameIdx; + std::optional PassNameIdx; + std::optional FunctionNameIdx; + std::optional SourceFileNameIdx; + std::optional SourceLine; + std::optional SourceColumn; + std::optional Hotness; struct Argument { - Optional KeyIdx; - Optional ValueIdx; - Optional SourceFileNameIdx; - Optional SourceLine; - Optional SourceColumn; + std::optional KeyIdx; + std::optional ValueIdx; + std::optional SourceFileNameIdx; + std::optional SourceLine; + std::optional SourceColumn; }; - Optional> Args; + std::optional> Args; /// Avoid re-allocating a vector every time. SmallVector TmpArgs; diff --git a/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h b/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h index f3c2c0d..6236800 100644 --- a/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h +++ b/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h @@ -106,8 +106,8 @@ struct BitstreamRemarkSerializerHelper { /// Emit the metadata for the remarks. void emitMetaBlock(uint64_t ContainerVersion, - Optional RemarkVersion, - Optional StrTab = std::nullopt, + std::optional RemarkVersion, + std::optional StrTab = std::nullopt, std::optional Filename = std::nullopt); /// Emit a remark block. The string table is required. @@ -162,19 +162,19 @@ struct BitstreamMetaSerializer : public MetaSerializer { /// BitstreamRemarkSerializerHelper, or with [2] one that is owned by the meta /// serializer. In case of [1], we need to be able to store a reference to the /// object, while in case of [2] we need to store the whole object. - Optional TmpHelper; + std::optional TmpHelper; /// The actual helper, that can point to \p TmpHelper or to an external helper /// object. BitstreamRemarkSerializerHelper *Helper = nullptr; - Optional StrTab; + std::optional StrTab; std::optional ExternalFilename; /// Create a new meta serializer based on \p ContainerType. - BitstreamMetaSerializer(raw_ostream &OS, - BitstreamRemarkContainerType ContainerType, - Optional StrTab = std::nullopt, - std::optional ExternalFilename = std::nullopt) + BitstreamMetaSerializer( + raw_ostream &OS, BitstreamRemarkContainerType ContainerType, + std::optional StrTab = std::nullopt, + std::optional ExternalFilename = std::nullopt) : MetaSerializer(OS), TmpHelper(std::nullopt), Helper(nullptr), StrTab(StrTab), ExternalFilename(ExternalFilename) { TmpHelper.emplace(ContainerType); @@ -182,10 +182,10 @@ struct BitstreamMetaSerializer : public MetaSerializer { } /// Create a new meta serializer based on a previously built \p Helper. - BitstreamMetaSerializer(raw_ostream &OS, - BitstreamRemarkSerializerHelper &Helper, - Optional StrTab = std::nullopt, - std::optional ExternalFilename = std::nullopt) + BitstreamMetaSerializer( + raw_ostream &OS, BitstreamRemarkSerializerHelper &Helper, + std::optional StrTab = std::nullopt, + std::optional ExternalFilename = std::nullopt) : MetaSerializer(OS), TmpHelper(std::nullopt), Helper(&Helper), StrTab(StrTab), ExternalFilename(ExternalFilename) {} diff --git a/llvm/include/llvm/Remarks/RemarkLinker.h b/llvm/include/llvm/Remarks/RemarkLinker.h index f5d8d9b..307eb3f 100644 --- a/llvm/include/llvm/Remarks/RemarkLinker.h +++ b/llvm/include/llvm/Remarks/RemarkLinker.h @@ -18,6 +18,7 @@ #include "llvm/Remarks/RemarkStringTable.h" #include "llvm/Support/Error.h" #include +#include #include namespace llvm { @@ -51,7 +52,7 @@ private: std::set, RemarkPtrCompare> Remarks; /// A path to append before the external file path found in remark metadata. - Optional PrependPath; + std::optional PrependPath; /// Keep this remark. If it's already in the set, discard it. Remark &keep(std::unique_ptr Remark); @@ -65,12 +66,13 @@ public: /// \p Buffer. /// \p Buffer can be either a standalone remark container or just /// metadata. This takes care of uniquing and merging the remarks. - Error link(StringRef Buffer, Optional RemarkFormat = std::nullopt); + Error link(StringRef Buffer, + std::optional RemarkFormat = std::nullopt); /// Link the remarks found in \p Obj by looking for the right section and /// calling the method above. Error link(const object::ObjectFile &Obj, - Optional RemarkFormat = std::nullopt); + std::optional RemarkFormat = std::nullopt); /// Serialize the linked remarks to the stream \p OS, using the format \p /// RemarkFormat. @@ -94,7 +96,7 @@ public: /// Returns a buffer with the contents of the remarks section depending on the /// format of the file. If the section doesn't exist, this returns an empty /// optional. -Expected> +Expected> getRemarksSectionContents(const object::ObjectFile &Obj); } // end namespace remarks diff --git a/llvm/include/llvm/Remarks/RemarkParser.h b/llvm/include/llvm/Remarks/RemarkParser.h index f131857..1333c58 100644 --- a/llvm/include/llvm/Remarks/RemarkParser.h +++ b/llvm/include/llvm/Remarks/RemarkParser.h @@ -17,6 +17,7 @@ #include "llvm/Remarks/RemarkFormat.h" #include "llvm/Support/Error.h" #include +#include namespace llvm { namespace remarks { @@ -84,8 +85,8 @@ createRemarkParser(Format ParserFormat, StringRef Buf, Expected> createRemarkParserFromMeta( Format ParserFormat, StringRef Buf, - Optional StrTab = std::nullopt, - Optional ExternalFilePrependPath = std::nullopt); + std::optional StrTab = std::nullopt, + std::optional ExternalFilePrependPath = std::nullopt); } // end namespace remarks } // end namespace llvm diff --git a/llvm/include/llvm/Remarks/RemarkStreamer.h b/llvm/include/llvm/Remarks/RemarkStreamer.h index c86394f..5b1cc81 100644 --- a/llvm/include/llvm/Remarks/RemarkStreamer.h +++ b/llvm/include/llvm/Remarks/RemarkStreamer.h @@ -30,11 +30,11 @@ #ifndef LLVM_REMARKS_REMARKSTREAMER_H #define LLVM_REMARKS_REMARKSTREAMER_H -#include "llvm/ADT/Optional.h" #include "llvm/Remarks/RemarkSerializer.h" #include "llvm/Support/Error.h" #include "llvm/Support/Regex.h" #include +#include namespace llvm { @@ -43,19 +43,19 @@ class raw_ostream; namespace remarks { class RemarkStreamer final { /// The regex used to filter remarks based on the passes that emit them. - Optional PassFilter; + std::optional PassFilter; /// The object used to serialize the remarks to a specific format. std::unique_ptr RemarkSerializer; /// The filename that the remark diagnostics are emitted to. - const Optional Filename; + const std::optional Filename; public: RemarkStreamer(std::unique_ptr RemarkSerializer, - Optional Filename = std::nullopt); + std::optional Filename = std::nullopt); /// Return the filename that the remark diagnostics are emitted to. - Optional getFilename() const { - return Filename ? Optional(*Filename) : std::nullopt; + std::optional getFilename() const { + return Filename ? std::optional(*Filename) : std::nullopt; } /// Return stream that the remark diagnostics are emitted to. raw_ostream &getStream() { return RemarkSerializer->OS; } diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 11eff4d..f87e2cd 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -2059,7 +2059,7 @@ void AsmPrinter::emitRemarksSection(remarks::RemarkStreamer &RS) { remarks::RemarkSerializer &RemarkSerializer = RS.getSerializer(); std::optional> Filename; - if (Optional FilenameRef = RS.getFilename()) { + if (std::optional FilenameRef = RS.getFilename()) { Filename = *FilenameRef; sys::fs::make_absolute(*Filename); assert(!Filename->empty() && "The filename can't be empty."); diff --git a/llvm/lib/Remarks/BitstreamRemarkParser.cpp b/llvm/lib/Remarks/BitstreamRemarkParser.cpp index 08b8386..85fe814 100644 --- a/llvm/lib/Remarks/BitstreamRemarkParser.cpp +++ b/llvm/lib/Remarks/BitstreamRemarkParser.cpp @@ -307,8 +307,8 @@ static Error advanceToMetaBlock(BitstreamParserHelper &Helper) { Expected> remarks::createBitstreamParserFromMeta( - StringRef Buf, Optional StrTab, - Optional ExternalFilePrependPath) { + StringRef Buf, std::optional StrTab, + std::optional ExternalFilePrependPath) { BitstreamParserHelper Helper(Buf); Expected> MagicNumber = Helper.parseMagic(); if (!MagicNumber) @@ -367,14 +367,14 @@ Error BitstreamRemarkParser::parseMeta() { Error BitstreamRemarkParser::processCommonMeta( BitstreamMetaParserHelper &Helper) { - if (Optional Version = Helper.ContainerVersion) + if (std::optional Version = Helper.ContainerVersion) ContainerVersion = *Version; else return createStringError( std::make_error_code(std::errc::illegal_byte_sequence), "Error while parsing BLOCK_META: missing container version."); - if (Optional Type = Helper.ContainerType) { + if (std::optional Type = Helper.ContainerType) { // Always >= BitstreamRemarkContainerType::First since it's unsigned. if (*Type > static_cast(BitstreamRemarkContainerType::Last)) return createStringError( @@ -391,7 +391,7 @@ Error BitstreamRemarkParser::processCommonMeta( } static Error processStrTab(BitstreamRemarkParser &P, - Optional StrTabBuf) { + std::optional StrTabBuf) { if (!StrTabBuf) return createStringError( std::make_error_code(std::errc::illegal_byte_sequence), @@ -402,7 +402,7 @@ static Error processStrTab(BitstreamRemarkParser &P, } static Error processRemarkVersion(BitstreamRemarkParser &P, - Optional RemarkVersion) { + std::optional RemarkVersion) { if (!RemarkVersion) return createStringError( std::make_error_code(std::errc::illegal_byte_sequence), @@ -412,7 +412,7 @@ static Error processRemarkVersion(BitstreamRemarkParser &P, } Error BitstreamRemarkParser::processExternalFilePath( - Optional ExternalFilePath) { + std::optional ExternalFilePath) { if (!ExternalFilePath) return createStringError( std::make_error_code(std::errc::illegal_byte_sequence), diff --git a/llvm/lib/Remarks/BitstreamRemarkParser.h b/llvm/lib/Remarks/BitstreamRemarkParser.h index 78f18a6..fc786fc 100644 --- a/llvm/lib/Remarks/BitstreamRemarkParser.h +++ b/llvm/lib/Remarks/BitstreamRemarkParser.h @@ -13,13 +13,13 @@ #ifndef LLVM_LIB_REMARKS_BITSTREAM_REMARK_PARSER_H #define LLVM_LIB_REMARKS_BITSTREAM_REMARK_PARSER_H -#include "llvm/ADT/Optional.h" #include "llvm/Remarks/BitstreamRemarkContainer.h" #include "llvm/Remarks/BitstreamRemarkParser.h" #include "llvm/Remarks/RemarkFormat.h" #include "llvm/Remarks/RemarkParser.h" #include #include +#include namespace llvm { namespace remarks { @@ -31,7 +31,7 @@ struct BitstreamRemarkParser : public RemarkParser { /// The buffer to parse. BitstreamParserHelper ParserHelper; /// The string table used for parsing strings. - Optional StrTab; + std::optional StrTab; /// Temporary remark buffer used when the remarks are stored separately. std::unique_ptr TmpRemarkBuffer; /// The common metadata used to decide how to parse the buffer. @@ -73,12 +73,12 @@ private: Error processSeparateRemarksMetaMeta(BitstreamMetaParserHelper &Helper); Expected> processRemark(BitstreamRemarkParserHelper &Helper); - Error processExternalFilePath(Optional ExternalFilePath); + Error processExternalFilePath(std::optional ExternalFilePath); }; Expected> createBitstreamParserFromMeta( - StringRef Buf, Optional StrTab = std::nullopt, - Optional ExternalFilePrependPath = std::nullopt); + StringRef Buf, std::optional StrTab = std::nullopt, + std::optional ExternalFilePrependPath = std::nullopt); } // end namespace remarks } // end namespace llvm diff --git a/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp b/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp index 5428967..b262719 100644 --- a/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp +++ b/llvm/lib/Remarks/BitstreamRemarkSerializer.cpp @@ -232,8 +232,9 @@ void BitstreamRemarkSerializerHelper::setupBlockInfo() { } void BitstreamRemarkSerializerHelper::emitMetaBlock( - uint64_t ContainerVersion, Optional RemarkVersion, - Optional StrTab, std::optional Filename) { + uint64_t ContainerVersion, std::optional RemarkVersion, + std::optional StrTab, + std::optional Filename) { // Emit the meta block Bitstream.EnterSubblock(META_BLOCK_ID, 3); @@ -354,7 +355,8 @@ void BitstreamRemarkSerializer::emit(const Remark &Remark) { Helper.ContainerType == BitstreamRemarkContainerType::Standalone; BitstreamMetaSerializer MetaSerializer( OS, Helper, - IsStandalone ? &*StrTab : Optional(std::nullopt)); + IsStandalone ? &*StrTab + : std::optional(std::nullopt)); MetaSerializer.emit(); DidSetUp = true; } diff --git a/llvm/lib/Remarks/RemarkLinker.cpp b/llvm/lib/Remarks/RemarkLinker.cpp index d21bcb1..74acb08 100644 --- a/llvm/lib/Remarks/RemarkLinker.cpp +++ b/llvm/lib/Remarks/RemarkLinker.cpp @@ -17,6 +17,7 @@ #include "llvm/Remarks/RemarkParser.h" #include "llvm/Remarks/RemarkSerializer.h" #include "llvm/Support/Error.h" +#include using namespace llvm; using namespace llvm::remarks; @@ -34,7 +35,7 @@ getRemarksSectionName(const object::ObjectFile &Obj) { "Unsupported file format."); } -Expected> +Expected> llvm::remarks::getRemarksSectionContents(const object::ObjectFile &Obj) { Expected SectionName = getRemarksSectionName(Obj); if (!SectionName) @@ -52,7 +53,7 @@ llvm::remarks::getRemarksSectionContents(const object::ObjectFile &Obj) { else return Contents.takeError(); } - return Optional{}; + return std::optional{}; } Remark &RemarkLinker::keep(std::unique_ptr Remark) { @@ -68,7 +69,7 @@ void RemarkLinker::setExternalFilePrependPath(StringRef PrependPathIn) { // Discard remarks with no source location. static bool shouldKeepRemark(const Remark &R) { return R.Loc.has_value(); } -Error RemarkLinker::link(StringRef Buffer, Optional RemarkFormat) { +Error RemarkLinker::link(StringRef Buffer, std::optional RemarkFormat) { if (!RemarkFormat) { Expected ParserFormat = magicToFormat(Buffer); if (!ParserFormat) @@ -79,8 +80,8 @@ Error RemarkLinker::link(StringRef Buffer, Optional RemarkFormat) { Expected> MaybeParser = createRemarkParserFromMeta( *RemarkFormat, Buffer, /*StrTab=*/std::nullopt, - PrependPath ? Optional(StringRef(*PrependPath)) - : Optional()); + PrependPath ? std::optional(StringRef(*PrependPath)) + : std::optional()); if (!MaybeParser) return MaybeParser.takeError(); @@ -105,12 +106,13 @@ Error RemarkLinker::link(StringRef Buffer, Optional RemarkFormat) { } Error RemarkLinker::link(const object::ObjectFile &Obj, - Optional RemarkFormat) { - Expected> SectionOrErr = getRemarksSectionContents(Obj); + std::optional RemarkFormat) { + Expected> SectionOrErr = + getRemarksSectionContents(Obj); if (!SectionOrErr) return SectionOrErr.takeError(); - if (Optional Section = *SectionOrErr) + if (std::optional Section = *SectionOrErr) return link(*Section, RemarkFormat); return Error::success(); } diff --git a/llvm/lib/Remarks/RemarkParser.cpp b/llvm/lib/Remarks/RemarkParser.cpp index 67ec0b0..7fccb94 100644 --- a/llvm/lib/Remarks/RemarkParser.cpp +++ b/llvm/lib/Remarks/RemarkParser.cpp @@ -87,8 +87,8 @@ llvm::remarks::createRemarkParser(Format ParserFormat, StringRef Buf, Expected> llvm::remarks::createRemarkParserFromMeta( - Format ParserFormat, StringRef Buf, Optional StrTab, - Optional ExternalFilePrependPath) { + Format ParserFormat, StringRef Buf, std::optional StrTab, + std::optional ExternalFilePrependPath) { switch (ParserFormat) { // Depending on the metadata, the format can be either yaml or yaml-strtab, // regardless of the input argument. diff --git a/llvm/lib/Remarks/RemarkStreamer.cpp b/llvm/lib/Remarks/RemarkStreamer.cpp index 8ad2ce6..9f4676c 100644 --- a/llvm/lib/Remarks/RemarkStreamer.cpp +++ b/llvm/lib/Remarks/RemarkStreamer.cpp @@ -12,6 +12,7 @@ #include "llvm/Remarks/RemarkStreamer.h" #include "llvm/Support/CommandLine.h" +#include using namespace llvm; using namespace llvm::remarks; @@ -25,9 +26,9 @@ static cl::opt EnableRemarksSection( RemarkStreamer::RemarkStreamer( std::unique_ptr RemarkSerializer, - Optional FilenameIn) + std::optional FilenameIn) : RemarkSerializer(std::move(RemarkSerializer)), - Filename(FilenameIn ? Optional(FilenameIn->str()) + Filename(FilenameIn ? std::optional(FilenameIn->str()) : std::nullopt) {} Error RemarkStreamer::setFilter(StringRef Filter) { diff --git a/llvm/lib/Remarks/YAMLRemarkParser.cpp b/llvm/lib/Remarks/YAMLRemarkParser.cpp index 265371c..4996ab6 100644 --- a/llvm/lib/Remarks/YAMLRemarkParser.cpp +++ b/llvm/lib/Remarks/YAMLRemarkParser.cpp @@ -108,10 +108,9 @@ static Expected parseStrTab(StringRef &Buf, return Expected(std::move(Result)); } -Expected> -remarks::createYAMLParserFromMeta(StringRef Buf, - Optional StrTab, - Optional ExternalFilePrependPath) { +Expected> remarks::createYAMLParserFromMeta( + StringRef Buf, std::optional StrTab, + std::optional ExternalFilePrependPath) { // We now have a magic number. The metadata has to be correct. Expected isMeta = parseMagic(Buf); if (!isMeta) @@ -171,7 +170,7 @@ YAMLRemarkParser::YAMLRemarkParser(StringRef Buf) : YAMLRemarkParser(Buf, std::nullopt) {} YAMLRemarkParser::YAMLRemarkParser(StringRef Buf, - Optional StrTab) + std::optional StrTab) : RemarkParser{Format::YAML}, StrTab(std::move(StrTab)), SM(setupSM(LastErrorMessage)), Stream(Buf, SM), YAMLIt(Stream.begin()) {} diff --git a/llvm/lib/Remarks/YAMLRemarkParser.h b/llvm/lib/Remarks/YAMLRemarkParser.h index 44425e8..8ef72e1 100644 --- a/llvm/lib/Remarks/YAMLRemarkParser.h +++ b/llvm/lib/Remarks/YAMLRemarkParser.h @@ -13,7 +13,6 @@ #ifndef LLVM_REMARKS_YAML_REMARK_PARSER_H #define LLVM_REMARKS_YAML_REMARK_PARSER_H -#include "llvm/ADT/Optional.h" #include "llvm/Remarks/Remark.h" #include "llvm/Remarks/RemarkParser.h" #include "llvm/Support/Error.h" @@ -21,6 +20,7 @@ #include "llvm/Support/SourceMgr.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" +#include #include namespace llvm { @@ -47,7 +47,7 @@ private: /// Regular YAML to Remark parser. struct YAMLRemarkParser : public RemarkParser { /// The string table used for parsing strings. - Optional StrTab; + std::optional StrTab; /// Last error message that can come from the YAML parser diagnostics. /// We need this for catching errors in the constructor. std::string LastErrorMessage; @@ -70,7 +70,7 @@ struct YAMLRemarkParser : public RemarkParser { } protected: - YAMLRemarkParser(StringRef Buf, Optional StrTab); + YAMLRemarkParser(StringRef Buf, std::optional StrTab); /// Create a YAMLParseError error from an existing error generated by the YAML /// parser. /// If there is no error, this returns Success. @@ -108,8 +108,8 @@ protected: }; Expected> createYAMLParserFromMeta( - StringRef Buf, Optional StrTab = std::nullopt, - Optional ExternalFilePrependPath = std::nullopt); + StringRef Buf, std::optional StrTab = std::nullopt, + std::optional ExternalFilePrependPath = std::nullopt); } // end namespace remarks } // end namespace llvm diff --git a/llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp b/llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp index 2741a79..85b6fb4 100644 --- a/llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp +++ b/llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp @@ -10,6 +10,7 @@ #include "llvm/Remarks/Remark.h" #include "llvm/Remarks/RemarkParser.h" #include "gtest/gtest.h" +#include using namespace llvm; @@ -70,7 +71,7 @@ enum class CmpType { void parseExpectErrorMeta( StringRef Buf, const char *Error, CmpType Cmp, - Optional ExternalFilePrependPath = std::nullopt) { + std::optional ExternalFilePrependPath = std::nullopt) { std::string ErrorStr; raw_string_ostream Stream(ErrorStr); -- cgit v1.1