[lld] 59cc8fb - [MachO] Use std::optional in ExportTrie.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 20:59:09 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T20:59:04-08:00
New Revision: 59cc8fb785621c4c657c1a499a36624d9089f1ea

URL: https://github.com/llvm/llvm-project/commit/59cc8fb785621c4c657c1a499a36624d9089f1ea
DIFF: https://github.com/llvm/llvm-project/commit/59cc8fb785621c4c657c1a499a36624d9089f1ea.diff

LOG: [MachO] Use std::optional in ExportTrie.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: 
    lld/MachO/ExportTrie.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/ExportTrie.cpp b/lld/MachO/ExportTrie.cpp
index b95ad9be009e..810864f31899 100644
--- a/lld/MachO/ExportTrie.cpp
+++ b/lld/MachO/ExportTrie.cpp
@@ -42,6 +42,7 @@
 #include "llvm/ADT/Optional.h"
 #include "llvm/BinaryFormat/MachO.h"
 #include "llvm/Support/LEB128.h"
+#include <optional>
 
 using namespace llvm;
 using namespace lld;
@@ -81,7 +82,7 @@ struct ExportInfo {
 
 struct macho::TrieNode {
   std::vector<Edge> edges;
-  Optional<ExportInfo> info;
+  std::optional<ExportInfo> info;
   // Estimated offset from the start of the serialized trie to the current node.
   // This will converge to the true offset when updateOffset() is run to a
   // fixpoint.


        


More information about the llvm-commits mailing list