[Mlir-commits] [mlir] 100c386 - [AliasAnalysis] Use std::optional in LocalAliasAnalysis.cpp (NFC)

Kazu Hirata llvmlistbot at llvm.org
Sat Dec 10 10:20:53 PST 2022


Author: Kazu Hirata
Date: 2022-12-10T10:20:47-08:00
New Revision: 100c386725c128ce10625b76bbed513464426e29

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

LOG: [AliasAnalysis] Use std::optional in LocalAliasAnalysis.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: 
    mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp b/mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp
index 0c9beeaaf3016..a69935601ee0f 100644
--- a/mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp
+++ b/mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp
@@ -13,6 +13,7 @@
 #include "mlir/Interfaces/ControlFlowInterfaces.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
 #include "mlir/Interfaces/ViewLikeInterface.h"
+#include <optional>
 
 using namespace mlir;
 
@@ -330,7 +331,7 @@ AliasResult LocalAliasAnalysis::alias(Value lhs, Value rhs) {
     return AliasResult::MayAlias;
 
   // Check the alias results against each of the underlying values.
-  Optional<AliasResult> result;
+  std::optional<AliasResult> result;
   for (Value lhsVal : lhsValues) {
     for (Value rhsVal : rhsValues) {
       AliasResult nextResult = aliasImpl(lhsVal, rhsVal);


        


More information about the Mlir-commits mailing list