@@ -45,8 +45,7 @@ static mlir::Type getResultArgumentType(mlir::Type resultType,
45
45
[&](mlir::Type type) -> mlir::Type {
46
46
if (options.boxResult )
47
47
return fir::BoxType::get (type);
48
- else
49
- return fir::ReferenceType::get (type);
48
+ return fir::ReferenceType::get (type);
50
49
})
51
50
.Case <fir::BoxType>([](mlir::Type type) -> mlir::Type {
52
51
return fir::ReferenceType::get (type);
@@ -162,12 +161,12 @@ class ReturnOpConversion : public mlir::OpRewritePattern<mlir::ReturnOp> {
162
161
rewriter.setInsertionPoint (ret);
163
162
auto returnedValue = ret.getOperand (0 );
164
163
bool replacedStorage = false ;
165
- if (auto op = returnedValue.getDefiningOp ())
164
+ if (auto * op = returnedValue.getDefiningOp ())
166
165
if (auto load = mlir::dyn_cast<fir::LoadOp>(op)) {
167
166
auto resultStorage = load.memref ();
168
167
load.memref ().replaceAllUsesWith (options.newArg );
169
168
replacedStorage = true ;
170
- if (auto alloc = resultStorage.getDefiningOp ())
169
+ if (auto * alloc = resultStorage.getDefiningOp ())
171
170
if (alloc->use_empty ())
172
171
rewriter.eraseOp (alloc);
173
172
}
@@ -249,7 +248,8 @@ class AbstractResultOpt : public fir::AbstractResultOptBase<AbstractResultOpt> {
249
248
return ;
250
249
251
250
// 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>();
253
253
target.addIllegalOp <fir::SaveResultOp>();
254
254
target.addDynamicallyLegalOp <fir::CallOp>([](fir::CallOp call) {
255
255
return !mustConvertCallOrFunc (call.getFunctionType ());
0 commit comments