[StandardToHandshake] Fix function type for external FuncOps (#2987)

This commit is contained in:
Morten Borup Petersen 2022-04-27 17:17:27 +02:00 committed by GitHub
parent 8709992be0
commit 6af3152e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -1848,15 +1848,13 @@ static LogicalResult lowerFuncOp(func::FuncOp funcOp, MLIRContext *ctx,
// Get function arguments
llvm::SmallVector<mlir::Type, 8> argTypes;
for (auto &arg : funcOp.getArguments()) {
mlir::Type type = arg.getType();
argTypes.push_back(type);
}
for (auto &argType : funcOp.getArgumentTypes())
argTypes.push_back(argType);
// Get function results
llvm::SmallVector<mlir::Type, 8> resTypes;
for (auto arg : funcOp.getResultTypes())
resTypes.push_back(arg);
for (auto resType : funcOp.getResultTypes())
resTypes.push_back(resType);
handshake::FuncOp newFuncOp;

View File

@ -17,7 +17,7 @@ func @main(%c : i1, %a : i32, %b : i32) -> i32 {
// Test function without body (external function).
// CHECK-LABEL: handshake.func private @foo(none, ...) -> (i32, none)
// CHECK-LABEL: handshake.func private @foo(i32, i32, none, ...) -> (i32, none)
module {
func private @foo(%a:i32, %b: i32) -> i32
}