[llvm] 316372f - [ObjCopy] Use std::optional instead of llvm::Optional in CommonConfig.h (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 22:34:17 PST 2022


Author: Kazu Hirata
Date: 2022-12-07T22:34:07-08:00
New Revision: 316372f89372c3f4d9842d69a825f67f11cf2bd4

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

LOG: [ObjCopy] Use std::optional instead of llvm::Optional in CommonConfig.h (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/include/llvm/ObjCopy/CommonConfig.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ObjCopy/CommonConfig.h b/llvm/include/llvm/ObjCopy/CommonConfig.h
index 81009d0c2b5ff..71c5e3d84eb7c 100644
--- a/llvm/include/llvm/ObjCopy/CommonConfig.h
+++ b/llvm/include/llvm/ObjCopy/CommonConfig.h
@@ -22,6 +22,7 @@
 #include "llvm/Support/Regex.h"
 // Necessary for llvm::DebugCompressionType::None
 #include "llvm/Target/TargetOptions.h"
+#include <optional>
 #include <vector>
 
 namespace llvm {
@@ -75,7 +76,7 @@ enum SectionFlag {
 struct SectionRename {
   StringRef OriginalName;
   StringRef NewName;
-  Optional<SectionFlag> NewFlags;
+  std::optional<SectionFlag> NewFlags;
 };
 
 struct SectionFlagsUpdate {
@@ -206,7 +207,7 @@ struct CommonConfig {
   FileFormat OutputFormat = FileFormat::Unspecified;
 
   // Only applicable when --output-format!=binary (e.g. elf64-x86-64).
-  Optional<MachineInfo> OutputArch;
+  std::optional<MachineInfo> OutputArch;
 
   // Advanced options
   StringRef AddGnuDebugLink;


        


More information about the llvm-commits mailing list