[llvm] b738ea0 - [ObjectYAML] Use std::optional in CodeViewYAMLSymbols.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 12:31:51 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T12:31:45-08:00
New Revision: b738ea08ec3367356d64c02e6e656af2c8ebdc5e

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

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
index f239f0e74d42d..3f758fdc6879e 100644
--- a/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
+++ b/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
@@ -30,6 +30,7 @@
 #include <algorithm>
 #include <cstdint>
 #include <cstring>
+#include <optional>
 #include <string>
 #include <vector>
 
@@ -151,7 +152,7 @@ void ScalarEnumerationTraits<RegisterId>::enumeration(IO &io, RegisterId &Reg) {
   const auto *Header = static_cast<COFF::header *>(io.getContext());
   assert(Header && "The IO context is not initialized");
 
-  Optional<CPUType> CpuType;
+  std::optional<CPUType> CpuType;
   ArrayRef<EnumEntry<uint16_t>> RegNames;
 
   switch (Header->Machine) {


        


More information about the llvm-commits mailing list