[flang] Fix warnings

This patch fixes:

  flang/../mlir/include/mlir/IR/TypeRange.h:51:19: error: 'ArrayRef'
  is deprecated: Use {} or ArrayRef<T>() instead
  [-Werror,-Wdeprecated-declarations]

  flang/../mlir/include/mlir/IR/ValueRange.h:401:20: error: 'ArrayRef'
  is deprecated: Use {} or ArrayRef<T>() instead
  [-Werror,-Wdeprecated-declarations]
This commit is contained in:
Kazu Hirata
2025-06-28 12:55:22 -07:00
parent 303bc0df6a
commit c57c5f53a3
3 changed files with 5 additions and 6 deletions

View File

@@ -753,7 +753,7 @@ static inline mlir::FunctionType genFuncType(mlir::MLIRContext *context,
}
if (TyR::ty == ParamTypeId::Void)
return mlir::FunctionType::get(context, argTypes, std::nullopt);
return mlir::FunctionType::get(context, argTypes, {});
auto resType = getTypeHelper(context, builder, TyR::ty, TyR::kind);
return mlir::FunctionType::get(context, argTypes, {resType});

View File

@@ -5150,9 +5150,9 @@ void IntrinsicLibrary::genIeeeGetOrSetModesOrStatus(
isModes ? fir::runtime::genGetModesTypeSize(builder, loc)
: fir::runtime::genGetStatusTypeSize(builder, loc);
byteSize = builder.createConvert(loc, builder.getIndexType(), byteSize);
addr =
builder.create<fir::AllocMemOp>(loc, extractSequenceType(heapTy),
/*typeparams=*/std::nullopt, byteSize);
addr = builder.create<fir::AllocMemOp>(loc, extractSequenceType(heapTy),
/*typeparams=*/mlir::ValueRange(),
byteSize);
mlir::Value shape = builder.create<fir::ShapeOp>(loc, byteSize);
builder.create<fir::StoreOp>(
loc, builder.create<fir::EmboxOp>(loc, fieldTy, addr, shape), fieldRef);

View File

@@ -2888,8 +2888,7 @@ void PPCIntrinsicLibrary::genVecStore(llvm::ArrayRef<fir::ExtendedValue> args) {
llvm_unreachable("invalid vector operation for generator");
}
auto funcType{
mlir::FunctionType::get(context, {stTy, addr.getType()}, std::nullopt)};
auto funcType{mlir::FunctionType::get(context, {stTy, addr.getType()}, {})};
mlir::func::FuncOp funcOp = builder.createFunction(loc, fname, funcType);
llvm::SmallVector<mlir::Value, 4> biArgs;