[llvm] 9f6c194 - [GSYM] Use std::optional in DwarfTransformer.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 11:49:37 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T11:49:32-08:00
New Revision: 9f6c1949bb2ea24410eeede33ef21f7a718b9a0f

URL: https://github.com/llvm/llvm-project/commit/9f6c1949bb2ea24410eeede33ef21f7a718b9a0f
DIFF: https://github.com/llvm/llvm-project/commit/9f6c1949bb2ea24410eeede33ef21f7a718b9a0f.diff

LOG: [GSYM] Use std::optional in DwarfTransformer.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/DwarfTransformer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
index 473a69b34ac38..f70e66ddcffae 100644
--- a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+++ b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
@@ -21,6 +21,7 @@
 #include "llvm/DebugInfo/GSYM/GsymCreator.h"
 #include "llvm/DebugInfo/GSYM/GsymReader.h"
 #include "llvm/DebugInfo/GSYM/InlineInfo.h"
+#include <optional>
 
 using namespace llvm;
 using namespace gsym;
@@ -128,9 +129,8 @@ static DWARFDie GetParentDeclContextDIE(DWARFDie &Die) {
 /// .debug_info. If we create a qualified name string in this function by
 /// combining multiple strings in the DWARF string table or info, we will make
 /// a copy of the string when we add it to the string table.
-static Optional<uint32_t> getQualifiedNameIndex(DWARFDie &Die,
-                                                uint64_t Language,
-                                                GsymCreator &Gsym) {
+static std::optional<uint32_t>
+getQualifiedNameIndex(DWARFDie &Die, uint64_t Language, GsymCreator &Gsym) {
   // If the dwarf has mangled name, use mangled name
   if (auto LinkageName =
           dwarf::toString(Die.findRecursively({dwarf::DW_AT_MIPS_linkage_name,


        


More information about the llvm-commits mailing list