[mlir][llvm] Add an explicit void type debug info attribute.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Thu, 12 Jan 2023 16:32:22 +0000 (17:32 +0100)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Thu, 12 Jan 2023 16:38:53 +0000 (17:38 +0100)
commita960547ea12128a67c99760f57bf01609a265546
tree594f05ff055a2ea0d0236d025e523e6635b94112
parente866fb8606d7ed2e27b194c97a4896e7680da2e0
[mlir][llvm] Add an explicit void type debug info attribute.

Previously, the DISubroutineType attribute used an optional result
parameter and an optional argument types array to model the subroutine
signature. LLVM IR debug metadata, on the other hand, has one types
list whose first entry maps to the result type. That entry may be
null to model a void result type. The type list may also be entirely
empty not specifying any type information. The latter is problematic
since the current DISubroutineType attribute cannot express it.

The revision changes DISubroutineTypeAttr to closely follow the
LLVM metadata design. In particular, it uses a single types parameter
array to model the subroutine signature and introduces an explicit
DIVoidResultTypeAttr to model the null entries.

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D141261
mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Target/LLVMIR/DebugImporter.cpp
mlir/lib/Target/LLVMIR/DebugTranslation.cpp
mlir/lib/Target/LLVMIR/DebugTranslation.h
mlir/test/Dialect/LLVMIR/debuginfo.mlir
mlir/test/Dialect/LLVMIR/invalid.mlir
mlir/test/Target/LLVMIR/Import/debug-info.ll
mlir/test/Target/LLVMIR/llvmir-debug.mlir