Skip to content

Commit

Permalink
[GSYM] Use std::optional in FunctionInfo.cpp (NFC)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kazutakahirata committed Nov 25, 2022
1 parent 9f6c194 commit 367515d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
Expand Up @@ -12,6 +12,7 @@
#include "llvm/DebugInfo/GSYM/LineTable.h"
#include "llvm/DebugInfo/GSYM/InlineInfo.h"
#include "llvm/Support/DataExtractor.h"
#include <optional>

using namespace llvm;
using namespace gsym;
Expand Down Expand Up @@ -178,8 +179,8 @@ llvm::Expected<LookupResult> FunctionInfo::lookup(DataExtractor &Data,
Offset - 4);
LR.FuncName = GR.getString(NameOffset);
bool Done = false;
Optional<LineEntry> LineEntry;
Optional<DataExtractor> InlineInfoData;
std::optional<LineEntry> LineEntry;
std::optional<DataExtractor> InlineInfoData;
while (!Done) {
if (!Data.isValidOffsetForDataOfSize(Offset, 8))
return createStringError(std::errc::io_error,
Expand Down

0 comments on commit 367515d

Please sign in to comment.