[mlir][llvm] A DICompositeTypeAttr is also a DIScopeAttr.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Thu, 12 Jan 2023 13:09:47 +0000 (14:09 +0100)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Thu, 12 Jan 2023 13:21:21 +0000 (14:21 +0100)
commit838fdefc52d33ebe759f0325a67112222cf6c2c0
tree620934abf41e957ee8cabd8fbb1a14ad7ad64132
parentf702c75995db9ea3978d39e3f3885b2113356f68
[mlir][llvm] A DICompositeTypeAttr is also a DIScopeAttr.

A DICompositeTypeAttr is the MLIR counterpart of LLVMIR's
DICompositeType debug metadata node. It can be used to store debug
information associated to a class or struct type definition. Any class
member method then sets its scope to the parent DICompositeType. This
revision adds DICompositeTypeAttr to the list of DIScopeAttrs to
prevent verification failures for legal debug information. Additionally,
it adds a number of test cases.

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D141480
mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
mlir/test/Dialect/LLVMIR/debuginfo.mlir
mlir/test/Target/LLVMIR/Import/debug-info.ll
mlir/test/Target/LLVMIR/llvmir-debug.mlir