[llvm] fda7968 - [LoongArch] Use std::nullopt instead of None (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 10 14:49:09 PST 2022


Author: Kazu Hirata
Date: 2022-12-10T14:49:03-08:00
New Revision: fda7968558d2e429198bccbee3463cea59466f7d

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

LOG: [LoongArch] Use std::nullopt instead of None (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/unittests/Target/LoongArch/InstSizes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Target/LoongArch/InstSizes.cpp b/llvm/unittests/Target/LoongArch/InstSizes.cpp
index b21eaccbbc756..1a5d4369c48be 100644
--- a/llvm/unittests/Target/LoongArch/InstSizes.cpp
+++ b/llvm/unittests/Target/LoongArch/InstSizes.cpp
@@ -5,6 +5,7 @@
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/TargetSelect.h"
+#include <optional>
 
 #include "gtest/gtest.h"
 
@@ -23,9 +24,9 @@ std::unique_ptr<LLVMTargetMachine> createTargetMachine() {
   std::string Error;
   const Target *TheTarget = TargetRegistry::lookupTarget(TT, Error);
 
-  return std::unique_ptr<LLVMTargetMachine>(
-      static_cast<LLVMTargetMachine *>(TheTarget->createTargetMachine(
-          TT, CPU, FS, TargetOptions(), None, None, CodeGenOpt::Default)));
+  return std::unique_ptr<LLVMTargetMachine>(static_cast<LLVMTargetMachine *>(
+      TheTarget->createTargetMachine(TT, CPU, FS, TargetOptions(), std::nullopt,
+                                     std::nullopt, CodeGenOpt::Default)));
 }
 
 std::unique_ptr<LoongArchInstrInfo> createInstrInfo(TargetMachine *TM) {


        


More information about the llvm-commits mailing list