[llvm] 367515d - [GSYM] Use std::optional in FunctionInfo.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 11:52:58 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T11:52:53-08:00
New Revision: 367515d4b724444a3b89b9a4021cde336383529c
URL: https://github.com/llvm/llvm-project/commit/367515d4b724444a3b89b9a4021cde336383529c
DIFF: https://github.com/llvm/llvm-project/commit/367515d4b724444a3b89b9a4021cde336383529c.diff
LOG: [GSYM] Use std::optional in FunctionInfo.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
Added:
Modified:
llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp b/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
index 4f5d240cdf72..b7d711d0f875 100644
--- a/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
+++ b/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
@@ -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;
@@ -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,
More information about the llvm-commits
mailing list