[llvm] 4e58c88 - [dsymutil] Use std::optional in DwarfLinkerForBinary.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 18:37:01 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T18:36:55-08:00
New Revision: 4e58c88c2d61c3aa80fd61b2ed911c4214a2f1c4

URL: https://github.com/llvm/llvm-project/commit/4e58c88c2d61c3aa80fd61b2ed911c4214a2f1c4
DIFF: https://github.com/llvm/llvm-project/commit/4e58c88c2d61c3aa80fd61b2ed911c4214a2f1c4.diff

LOG: [dsymutil] Use std::optional in DwarfLinkerForBinary.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/tools/dsymutil/DwarfLinkerForBinary.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
index b7cc05a28712c..208c2a7aa4973 100644
--- a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+++ b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
@@ -94,6 +94,7 @@
 #include <limits>
 #include <map>
 #include <memory>
+#include <optional>
 #include <string>
 #include <system_error>
 #include <tuple>
@@ -506,7 +507,7 @@ void DwarfLinkerForBinary::copySwiftReflectionMetadata(
   if (auto *MO = dyn_cast<llvm::object::MachOObjectFile>(OF->getBinary())) {
     // Collect the swift reflection sections before emitting them. This is
     // done so we control the order they're emitted.
-    std::array<Optional<object::SectionRef>,
+    std::array<std::optional<object::SectionRef>,
                Swift5ReflectionSectionKind::last + 1>
         SwiftSections;
     for (auto &Section : MO->sections()) {


        


More information about the llvm-commits mailing list