Skip to content

Commit e04be0d

Browse files
committed
[rebase] apply AbstractResult.cpp upstream format
1 parent cd10d3d commit e04be0d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

flang/lib/Optimizer/Transforms/AbstractResult.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ static mlir::Type getResultArgumentType(mlir::Type resultType,
4545
[&](mlir::Type type) -> mlir::Type {
4646
if (options.boxResult)
4747
return fir::BoxType::get(type);
48-
else
49-
return fir::ReferenceType::get(type);
48+
return fir::ReferenceType::get(type);
5049
})
5150
.Case<fir::BoxType>([](mlir::Type type) -> mlir::Type {
5251
return fir::ReferenceType::get(type);
@@ -162,12 +161,12 @@ class ReturnOpConversion : public mlir::OpRewritePattern<mlir::ReturnOp> {
162161
rewriter.setInsertionPoint(ret);
163162
auto returnedValue = ret.getOperand(0);
164163
bool replacedStorage = false;
165-
if (auto op = returnedValue.getDefiningOp())
164+
if (auto *op = returnedValue.getDefiningOp())
166165
if (auto load = mlir::dyn_cast<fir::LoadOp>(op)) {
167166
auto resultStorage = load.memref();
168167
load.memref().replaceAllUsesWith(options.newArg);
169168
replacedStorage = true;
170-
if (auto alloc = resultStorage.getDefiningOp())
169+
if (auto *alloc = resultStorage.getDefiningOp())
171170
if (alloc->use_empty())
172171
rewriter.eraseOp(alloc);
173172
}
@@ -249,7 +248,8 @@ class AbstractResultOpt : public fir::AbstractResultOptBase<AbstractResultOpt> {
249248
return;
250249

251250
// Convert the calls and, if needed, the ReturnOp in the function body.
252-
target.addLegalDialect<fir::FIROpsDialect, mlir::arith::ArithmeticDialect, mlir::StandardOpsDialect>();
251+
target.addLegalDialect<fir::FIROpsDialect, mlir::arith::ArithmeticDialect,
252+
mlir::StandardOpsDialect>();
253253
target.addIllegalOp<fir::SaveResultOp>();
254254
target.addDynamicallyLegalOp<fir::CallOp>([](fir::CallOp call) {
255255
return !mustConvertCallOrFunc(call.getFunctionType());

0 commit comments

Comments
 (0)