[llvm] 5076bdf - [CodeGen] Use std::optional in IndirectBrExpandPass.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 14:50:17 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T14:50:12-08:00
New Revision: 5076bdf6e9c244fee08831b9409cb5474625ab6f

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

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/IndirectBrExpandPass.cpp b/llvm/lib/CodeGen/IndirectBrExpandPass.cpp
index 52a3a76c581d..012892166ae7 100644
--- a/llvm/lib/CodeGen/IndirectBrExpandPass.cpp
+++ b/llvm/lib/CodeGen/IndirectBrExpandPass.cpp
@@ -40,6 +40,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Target/TargetMachine.h"
+#include <optional>
 
 using namespace llvm;
 
@@ -90,7 +91,7 @@ bool IndirectBrExpandPass::runOnFunction(Function &F) {
     return false;
   TLI = STI.getTargetLowering();
 
-  Optional<DomTreeUpdater> DTU;
+  std::optional<DomTreeUpdater> DTU;
   if (auto *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>())
     DTU.emplace(DTWP->getDomTree(), DomTreeUpdater::UpdateStrategy::Lazy);
 


        


More information about the llvm-commits mailing list