aboutsummaryrefslogtreecommitdiff
path: root/flang
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-07-25 00:55:06 -0700
committerKazu Hirata <kazu@google.com>2022-07-25 00:55:06 -0700
commitfac0fb4d966efe8c70d3e566cca6a5d0bd049302 (patch)
tree1ce36661a5bc5a821e07e20ca23fa2d71d4b839f /flang
parenta010d32abb9083ecf74c24876a482e5d04d1dba6 (diff)
downloadllvm-fac0fb4d966efe8c70d3e566cca6a5d0bd049302.zip
llvm-fac0fb4d966efe8c70d3e566cca6a5d0bd049302.tar.gz
llvm-fac0fb4d966efe8c70d3e566cca6a5d0bd049302.tar.bz2
[flang] Use X->foo() instead of X.getValue().foo() (NFC)
Flang C++ Style Guide tells us to use *X when the reference is protected by a presense test. However, (*X).foo() is a little harder to read, especially when X is a complicated expression. This patch slightly deviates from the guide (but retains the spirit) by using X->foo() instead. Differential Revision: https://reviews.llvm.org/D130413
Diffstat (limited to 'flang')
-rw-r--r--flang/lib/Optimizer/Transforms/AffinePromotion.cpp5
-rw-r--r--flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp6
2 files changed, 5 insertions, 6 deletions
diff --git a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
index 90b4364..4d2aa0e 100644
--- a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
+++ b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
@@ -239,9 +239,8 @@ private:
cmpOp.getPredicate(), rhsAffine.getValue() - lhsAffine.getValue());
if (!constraintPair)
return;
- integerSet = mlir::IntegerSet::get(dimCount, symCount,
- {constraintPair.getValue().first},
- {constraintPair.getValue().second});
+ integerSet = mlir::IntegerSet::get(
+ dimCount, symCount, {constraintPair->first}, {constraintPair->second});
}
llvm::Optional<std::pair<AffineExpr, bool>>
diff --git a/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp b/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp
index b88c186..42260ad 100644
--- a/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp
+++ b/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp
@@ -50,8 +50,8 @@ public:
rewriter.startRootUpdate(op);
auto callee = op.getCallee();
if (callee) {
- auto result = fir::NameUniquer::deconstruct(
- callee.getValue().getRootReference().getValue());
+ auto result =
+ fir::NameUniquer::deconstruct(callee->getRootReference().getValue());
if (fir::NameUniquer::isExternalFacingUniquedName(result))
op.setCalleeAttr(
SymbolRefAttr::get(op.getContext(), mangleExternalName(result)));
@@ -139,7 +139,7 @@ void ExternalNameConversionPass::runOnOperation() {
target.addDynamicallyLegalOp<fir::CallOp>([](fir::CallOp op) {
if (op.getCallee())
return !fir::NameUniquer::needExternalNameMangling(
- op.getCallee().getValue().getRootReference().getValue());
+ op.getCallee()->getRootReference().getValue());
return true;
});