[AsmParser] Use std::optional in AMDGPUAsmParser.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 26 Nov 2022 06:36:37 +0000 (22:36 -0800)
committerKazu Hirata <kazu@google.com>
Sat, 26 Nov 2022 06:36:37 +0000 (22:36 -0800)
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

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

index 974e231..7bb1ac3 100644 (file)
@@ -38,6 +38,7 @@
 #include "llvm/Support/MachineValueType.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/TargetParser.h"
+#include <optional>
 
 using namespace llvm;
 using namespace llvm::AMDGPU;
@@ -4990,7 +4991,7 @@ bool AMDGPUAsmParser::ParseDirectiveAMDHSAKernel() {
 
   // Track if the asm explicitly contains the directive for the user SGPR
   // count.
-  Optional<unsigned> ExplicitUserSGPRCount;
+  std::optional<unsigned> ExplicitUserSGPRCount;
   bool ReserveVCC = true;
   bool ReserveFlatScr = true;
   Optional<bool> EnableWavefrontSize32;