Skip to content

Commit 14de3d5

Browse files
definelichtgysit
authored andcommitted
[mlir][llvm] Don't return a dangling reference in getCallableResults().
Use the `getReturnTypes()` API (which returns an `ArrayRef<Type>`) rather than the `getReturnType()` API (which returns a `Type`) to avoid returning a dangling reference in `LLVMFuncOp::getCallableResults()`. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D136669
1 parent c4051b2 commit 14de3d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ def LLVM_LLVMFuncOp : LLVM_Op<"func", [
13411341
Region *getCallableRegion() { return &getBody(); }
13421342

13431343
/// Returns the callable result type, which is the function return type.
1344-
ArrayRef<Type> getCallableResults() { return getFunctionType().getReturnType(); }
1344+
ArrayRef<Type> getCallableResults() { return getFunctionType().getReturnTypes(); }
13451345

13461346
}];
13471347

0 commit comments

Comments
 (0)