[Mlir-commits] [mlir] 0595edd - [mlir][toy] Replace Optional::getValue with value. NFC

Fangrui Song llvmlistbot at llvm.org
Fri Jul 29 01:10:55 PDT 2022


Author: Fangrui Song
Date: 2022-07-29T01:10:51-07:00
New Revision: 0595edd80fd6eae751434790631e05112a0665d5

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

LOG: [mlir][toy] Replace Optional::getValue with value. NFC

Added: 
    

Modified: 
    mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch7/mlir/MLIRGen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
index 27a2feb0fd940..d929da8f6946b 100644
--- a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
@@ -221,7 +221,7 @@ class MLIRGenImpl {
     // 'return' takes an optional expression, handle that case here.
     mlir::Value expr = nullptr;
     if (ret.getExpr().hasValue()) {
-      if (!(expr = mlirGen(*ret.getExpr().getValue())))
+      if (!(expr = mlirGen(*ret.getExpr().value())))
         return mlir::failure();
     }
 

diff  --git a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
index 27a2feb0fd940..d929da8f6946b 100644
--- a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
@@ -221,7 +221,7 @@ class MLIRGenImpl {
     // 'return' takes an optional expression, handle that case here.
     mlir::Value expr = nullptr;
     if (ret.getExpr().hasValue()) {
-      if (!(expr = mlirGen(*ret.getExpr().getValue())))
+      if (!(expr = mlirGen(*ret.getExpr().value())))
         return mlir::failure();
     }
 

diff  --git a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
index a68c72a62113c..7bc908003cc87 100644
--- a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
@@ -225,7 +225,7 @@ class MLIRGenImpl {
     // 'return' takes an optional expression, handle that case here.
     mlir::Value expr = nullptr;
     if (ret.getExpr().hasValue()) {
-      if (!(expr = mlirGen(*ret.getExpr().getValue())))
+      if (!(expr = mlirGen(*ret.getExpr().value())))
         return mlir::failure();
     }
 

diff  --git a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
index a68c72a62113c..7bc908003cc87 100644
--- a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
@@ -225,7 +225,7 @@ class MLIRGenImpl {
     // 'return' takes an optional expression, handle that case here.
     mlir::Value expr = nullptr;
     if (ret.getExpr().hasValue()) {
-      if (!(expr = mlirGen(*ret.getExpr().getValue())))
+      if (!(expr = mlirGen(*ret.getExpr().value())))
         return mlir::failure();
     }
 

diff  --git a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
index a68c72a62113c..7bc908003cc87 100644
--- a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
@@ -225,7 +225,7 @@ class MLIRGenImpl {
     // 'return' takes an optional expression, handle that case here.
     mlir::Value expr = nullptr;
     if (ret.getExpr().hasValue()) {
-      if (!(expr = mlirGen(*ret.getExpr().getValue())))
+      if (!(expr = mlirGen(*ret.getExpr().value())))
         return mlir::failure();
     }
 

diff  --git a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
index 478f0de5670f3..2fcf8cc71e968 100644
--- a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
@@ -358,7 +358,7 @@ class MLIRGenImpl {
     // 'return' takes an optional expression, handle that case here.
     mlir::Value expr = nullptr;
     if (ret.getExpr().hasValue()) {
-      if (!(expr = mlirGen(*ret.getExpr().getValue())))
+      if (!(expr = mlirGen(*ret.getExpr().value())))
         return mlir::failure();
     }
 


        


More information about the Mlir-commits mailing list