14 #ifndef MLIR_LIB_TARGET_LLVMIR_DEBUGIMPORTER_H_
15 #define MLIR_LIB_TARGET_LLVMIR_DEBUGIMPORTER_H_
21 #include "llvm/ADT/MapVector.h"
22 #include "llvm/IR/DebugInfoMetadata.h"
34 DebugImporter(ModuleOp mlirModule,
bool dropDICompositeTypeElements);
43 DIGlobalVariableExpressionAttr
54 template <
typename DINodeT>
57 using MLIRTypeT = decltype(translateImpl(node));
58 return cast_or_null<MLIRTypeT>(
59 translate(
static_cast<llvm::DINode *
>(node)));
64 DIBasicTypeAttr translateImpl(llvm::DIBasicType *node);
65 DICompileUnitAttr translateImpl(llvm::DICompileUnit *node);
66 DICompositeTypeAttr translateImpl(llvm::DICompositeType *node);
67 DIDerivedTypeAttr translateImpl(llvm::DIDerivedType *node);
68 DIStringTypeAttr translateImpl(llvm::DIStringType *node);
69 DIFileAttr translateImpl(llvm::DIFile *node);
70 DILabelAttr translateImpl(llvm::DILabel *node);
71 DILexicalBlockAttr translateImpl(llvm::DILexicalBlock *node);
72 DILexicalBlockFileAttr translateImpl(llvm::DILexicalBlockFile *node);
73 DIGlobalVariableAttr translateImpl(llvm::DIGlobalVariable *node);
74 DILocalVariableAttr translateImpl(llvm::DILocalVariable *node);
76 DIModuleAttr translateImpl(llvm::DIModule *node);
77 DINamespaceAttr translateImpl(llvm::DINamespace *node);
78 DIImportedEntityAttr translateImpl(llvm::DIImportedEntity *node);
80 DISubprogramAttr translateImpl(llvm::DISubprogram *node);
81 DISubrangeAttr translateImpl(llvm::DISubrange *node);
82 DIGenericSubrangeAttr translateImpl(llvm::DIGenericSubrange *node);
83 DICommonBlockAttr translateImpl(llvm::DICommonBlock *node);
84 DISubroutineTypeAttr translateImpl(llvm::DISubroutineType *node);
89 StringAttr getStringAttrOrNull(llvm::MDString *stringNode);
95 std::optional<DINodeAttr> createRecSelf(llvm::DINode *node);
115 bool dropDICompositeTypeElements;
A cache for replacer-like functions that map values between two domains.
An attribute that associates a referenced attribute with a unique identifier.
This class represents the base attribute for all debug info attributes.
This class represents a LLVM attribute that describes a debug info scope.
This class represents a LLVM attribute that describes a debug info type.
This class represents a LLVM attribute that describes a debug info variable.
DINodeAttr translate(llvm::DINode *node)
Translates the given LLVM debug metadata to MLIR.
DIExpressionAttr translateExpression(llvm::DIExpression *node)
Translates the LLVM DWARF expression metadata to MLIR.
auto translate(DINodeT *node)
Infers the metadata type and translates it to MLIR.
DIGlobalVariableExpressionAttr translateGlobalVariableExpression(llvm::DIGlobalVariableExpression *node)
Translates the LLVM DWARF global variable expression metadata to MLIR.
Location translateLoc(llvm::DILocation *loc)
Translates the given LLVM debug location to an MLIR location.
Location translateFuncLocation(llvm::Function *func)
Translates the debug information for the given function into a Location.
DebugImporter(ModuleOp mlirModule, bool dropDICompositeTypeElements)
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
MLIRContext is the top-level object for a collection of MLIR operations.
Include the generated interface declarations.