[llvm] aad2d27 - [Utils] Use std::optional in AMDGPUBaseInfo.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 22:43:05 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T22:43:00-08:00
New Revision: aad2d272bf9e57bfc01c546224ca531783c0373b

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

LOG: [Utils] Use std::optional in AMDGPUBaseInfo.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/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 1c079887e63dc..97948168c9e7d 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -23,6 +23,7 @@
 #include "llvm/Support/AMDHSAKernelDescriptor.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/TargetParser.h"
+#include <optional>
 
 #define GET_INSTRINFO_NAMED_OPS
 #define GET_INSTRMAP_INFO
@@ -583,8 +584,8 @@ void AMDGPUTargetID::setTargetIDFromFeaturesString(StringRef FS) {
   // absence of the target features we assume we must generate code that can run
   // in any environment.
   SubtargetFeatures Features(FS);
-  Optional<bool> XnackRequested;
-  Optional<bool> SramEccRequested;
+  std::optional<bool> XnackRequested;
+  std::optional<bool> SramEccRequested;
 
   for (const std::string &Feature : Features.getFeatures()) {
     if (Feature == "+xnack")


        


More information about the llvm-commits mailing list