[llvm] 5b839fc - [CodeGen] Use std::optional in ShadowStackGCLowering.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 15:09:30 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T15:09:25-08:00
New Revision: 5b839fc2d052610d8b740a587e8f389733c9958d

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

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/ShadowStackGCLowering.cpp b/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
index 7401b825abb8..153fe77b8b4a 100644
--- a/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
+++ b/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
@@ -39,6 +39,7 @@
 #include "llvm/Support/Casting.h"
 #include "llvm/Transforms/Utils/EscapeEnumerator.h"
 #include <cassert>
+#include <optional>
 #include <string>
 #include <utility>
 #include <vector>
@@ -305,7 +306,7 @@ bool ShadowStackGCLowering::runOnFunction(Function &F) {
   if (Roots.empty())
     return false;
 
-  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