From 14de3d5c634bfacb24e16ebe14dc3b608fb0be9a Mon Sep 17 00:00:00 2001 From: Johannes de Fine Licht Date: Tue, 25 Oct 2022 15:52:59 +0300 Subject: [PATCH] [mlir][llvm] Don't return a dangling reference in getCallableResults(). Use the `getReturnTypes()` API (which returns an `ArrayRef`) 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 --- mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td index 18b7083..bcf55e1 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -1341,7 +1341,7 @@ def LLVM_LLVMFuncOp : LLVM_Op<"func", [ Region *getCallableRegion() { return &getBody(); } /// Returns the callable result type, which is the function return type. - ArrayRef getCallableResults() { return getFunctionType().getReturnType(); } + ArrayRef getCallableResults() { return getFunctionType().getReturnTypes(); } }]; -- 2.7.4