[llvm] 629819c - [IPO] Use std::optional in AttributorAttributes.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 23:23:46 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T23:23:40-08:00
New Revision: 629819cb6613eee442ba3c5b39b9c39b21969625

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

LOG: [IPO] Use std::optional in AttributorAttributes.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/Transforms/IPO/AttributorAttributes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 19b5043e24843..541975c68c562 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -62,6 +62,7 @@
 #include "llvm/Transforms/Utils/ValueMapper.h"
 #include <cassert>
 #include <numeric>
+#include <optional>
 
 using namespace llvm;
 
@@ -6153,7 +6154,7 @@ ChangeStatus AAHeapToStackFunction::updateImpl(Attributor &A) {
 
   LoopInfo *LI =
       A.getInfoCache().getAnalysisResultForFunction<LoopAnalysis>(*F);
-  Optional<bool> MayContainIrreducibleControl;
+  std::optional<bool> MayContainIrreducibleControl;
   auto IsInLoop = [&](BasicBlock &BB) {
     if (&F->getEntryBlock() == &BB)
       return false;


        


More information about the llvm-commits mailing list