[flang-commits] [flang] 3356d72 - [flang] Use value or * instead of getValue (NFC)
Kazu Hirata via flang-commits
flang-commits at lists.llvm.org
Mon Jul 25 23:01:21 PDT 2022
Author: Kazu Hirata
Date: 2022-07-25T23:01:01-07:00
New Revision: 3356d72a5ffa69324f8fdbc067c440cda8154797
URL: https://github.com/llvm/llvm-project/commit/3356d72a5ffa69324f8fdbc067c440cda8154797
DIFF: https://github.com/llvm/llvm-project/commit/3356d72a5ffa69324f8fdbc067c440cda8154797.diff
LOG: [flang] Use value or * instead of getValue (NFC)
This patch replaces x.getValue() with *x if the reference is obviously
protected by a presence check. Otherwise, it replaces x.getValue()
with x.value().
Added:
Modified:
flang/lib/Lower/Bridge.cpp
flang/lib/Optimizer/Transforms/AffinePromotion.cpp
Removed:
################################################################################
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index f8662ad12ced1..05af25a842e94 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -2283,9 +2283,9 @@ class FirConverter : public Fortran::lower::AbstractConverter {
}
if (lhsIsWholeAllocatable)
fir::factory::finalizeRealloc(
- *builder, loc, lhsMutableBox.getValue(),
+ *builder, loc, lhsMutableBox.value(),
/*lbounds=*/llvm::None, /*takeLboundsIfRealloc=*/false,
- lhsRealloc.getValue());
+ lhsRealloc.value());
},
// [2] User defined assignment. If the context is a scalar
diff --git a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
index 4d2aa0ee20355..331d951396e32 100644
--- a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
+++ b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
@@ -175,7 +175,7 @@ struct AffineIfCondition {
mlir::IntegerSet getIntegerSet() const {
assert(hasIntegerSet() && "integer set is missing");
- return integerSet.getValue();
+ return integerSet.value();
}
mlir::ValueRange getAffineArgs() const { return affineArgs; }
@@ -235,8 +235,8 @@ struct AffineIfCondition {
auto rhsAffine = toAffineExpr(cmpOp.getRhs());
if (!lhsAffine || !rhsAffine)
return;
- auto constraintPair = constraint(
- cmpOp.getPredicate(), rhsAffine.getValue() - lhsAffine.getValue());
+ auto constraintPair =
+ constraint(cmpOp.getPredicate(), *rhsAffine - *lhsAffine);
if (!constraintPair)
return;
integerSet = mlir::IntegerSet::get(
@@ -481,8 +481,8 @@ class AffineLoopConversion : public mlir::OpRewritePattern<fir::DoLoopOp> {
std::pair<mlir::AffineForOp, mlir::Value>
createAffineFor(fir::DoLoopOp op, mlir::PatternRewriter &rewriter) const {
if (auto constantStep = constantIntegerLike(op.getStep()))
- if (constantStep.getValue() > 0)
- return positiveConstantStep(op, constantStep.getValue(), rewriter);
+ if (*constantStep > 0)
+ return positiveConstantStep(op, *constantStep, rewriter);
return genericBounds(op, rewriter);
}
More information about the flang-commits
mailing list