[clang] [CIR] Add support for indirect calls (PR #139748)
Sirui Mu via cfe-commits
cfe-commits at lists.llvm.org
Wed May 14 09:38:40 PDT 2025
================
@@ -1500,6 +1507,14 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter,
converter.addConversion([&](cir::BF16Type type) -> mlir::Type {
return mlir::BFloat16Type::get(type.getContext());
});
+ converter.addConversion([&](cir::FuncType type) -> mlir::Type {
+ auto result = converter.convertType(type.getReturnType());
+ llvm::SmallVector<mlir::Type> arguments;
+ if (converter.convertTypes(type.getInputs(), arguments).failed())
+ llvm_unreachable("Failed to convert function type parameters");
----------------
Lancern wrote:
> Perhaps instead of saying failed use something like "cir::FuncType conversion NYI"?
The failure here is due to the function parameter type failing to be lowered, but the function type itself is properly handled. Is this message appropriate? It makes me think that the lowering of function type itself is broken.
https://github.com/llvm/llvm-project/pull/139748
More information about the cfe-commits
mailing list