[flang-commits] [flang] 993625b - [flang] Use value instead of getValue (NFC)

Kazu Hirata via flang-commits flang-commits at lists.llvm.org
Wed Jul 20 08:56:29 PDT 2022


Author: Kazu Hirata
Date: 2022-07-20T08:56:23-07:00
New Revision: 993625be80d602327b12c814ae7ea736e51bf693

URL: https://github.com/llvm/llvm-project/commit/993625be80d602327b12c814ae7ea736e51bf693
DIFF: https://github.com/llvm/llvm-project/commit/993625be80d602327b12c814ae7ea736e51bf693.diff

LOG: [flang] Use value instead of getValue (NFC)

Flang C++ Style Guide tells us to use x.value() when no presence test
is obviously protecting the reference.  Since assert can be disabled,
I don't count it as "protection" here.

Differential Revision: https://reviews.llvm.org/D130144

Added: 
    

Modified: 
    flang/include/flang/Lower/IterationSpace.h
    flang/lib/Lower/CustomIntrinsicCall.cpp
    flang/lib/Optimizer/Dialect/FIROps.cpp

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Lower/IterationSpace.h b/flang/include/flang/Lower/IterationSpace.h
index 7adbd94dca4a5..b2af504f4bc5a 100644
--- a/flang/include/flang/Lower/IterationSpace.h
+++ b/flang/include/flang/Lower/IterationSpace.h
@@ -475,7 +475,7 @@ class ExplicitIterSpace {
   /// Return the outermost loop in this FORALL nest.
   fir::DoLoopOp getOuterLoop() {
     assert(outerLoop.has_value());
-    return outerLoop.getValue();
+    return outerLoop.value();
   }
 
   /// Return the statement context for the entire, outermost FORALL construct.

diff  --git a/flang/lib/Lower/CustomIntrinsicCall.cpp b/flang/lib/Lower/CustomIntrinsicCall.cpp
index 043b1ccf74748..1eecd91f5d922 100644
--- a/flang/lib/Lower/CustomIntrinsicCall.cpp
+++ b/flang/lib/Lower/CustomIntrinsicCall.cpp
@@ -194,12 +194,12 @@ lowerIshftc(fir::FirOpBuilder &builder, mlir::Location loc,
          isPresentCheck(2) &&
          "only ISHFTC SIZE arg is expected to be dynamically optional here");
   assert(retTy && "ISFHTC must have a return type");
-  mlir::Type resultType = retTy.getValue();
+  mlir::Type resultType = retTy.value();
   llvm::SmallVector<fir::ExtendedValue> args;
   args.push_back(getOperand(0));
   args.push_back(getOperand(1));
   args.push_back(builder
-                     .genIfOp(loc, {resultType}, isPresentCheck(2).getValue(),
+                     .genIfOp(loc, {resultType}, isPresentCheck(2).value(),
                               /*withElseRegion=*/true)
                      .genThen([&]() {
                        fir::ExtendedValue sizeExv = getOperand(2);

diff  --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index 6f6eaf769bd8a..01c70659bb4e6 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -750,7 +750,7 @@ static void printCmpOp(mlir::OpAsmPrinter &p, OPTY op) {
             OPTY::getPredicateAttrName())
           .getInt());
   assert(predSym.has_value() && "invalid symbol value for predicate");
-  p << '"' << mlir::arith::stringifyCmpFPredicate(predSym.getValue()) << '"'
+  p << '"' << mlir::arith::stringifyCmpFPredicate(predSym.value()) << '"'
     << ", ";
   p.printOperand(op.getLhs());
   p << ", ";
@@ -809,7 +809,7 @@ mlir::arith::CmpFPredicate
 fir::CmpcOp::getPredicateByName(llvm::StringRef name) {
   auto pred = mlir::arith::symbolizeCmpFPredicate(name);
   assert(pred.has_value() && "invalid predicate name");
-  return pred.getValue();
+  return pred.value();
 }
 
 void fir::CmpcOp::print(mlir::OpAsmPrinter &p) { printCmpOp(p, *this); }


        


More information about the flang-commits mailing list