mirror of https://github.com/llvm/circt.git
[StandardToHandshake] Fix function type for external FuncOps (#2987)
This commit is contained in:
parent
8709992be0
commit
6af3152e93
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue