[MC] llvm::Optional => std::optional

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
This commit is contained in:
Fangrui Song
2022-12-04 21:36:08 +00:00
parent 12f6ac39bc
commit f4c16c4473
64 changed files with 272 additions and 254 deletions

View File

@@ -1513,7 +1513,7 @@ static inline void emitDwarfLineTable(
}
void DwarfLineTable::emitCU(MCStreamer *MCOS, MCDwarfLineTableParams Params,
Optional<MCDwarfLineStr> &LineStr,
std::optional<MCDwarfLineStr> &LineStr,
BinaryContext &BC) const {
if (!RawData.empty()) {
assert(MCLineSections.getMCLineEntries().empty() &&
@@ -1585,7 +1585,7 @@ void DwarfLineTable::emit(BinaryContext &BC, MCStreamer &Streamer) {
if (LineTables.empty())
return;
// In a v5 non-split line table, put the strings in a separate section.
Optional<MCDwarfLineStr> LineStr(std::nullopt);
std::optional<MCDwarfLineStr> LineStr;
ErrorOr<BinarySection &> LineStrSection =
BC.getUniqueSectionByName(".debug_line_str");
// Some versions of GCC output DWARF5 .debug_info, but DWARF4 or lower