66 mlir::LLVM::DITypeAttr lookup(mlir::Type);
67 ActiveLevels startTranslating(mlir::Type,
68 mlir::LLVM::DITypeAttr placeHolder =
nullptr);
69 void finalize(mlir::Type, mlir::LLVM::DITypeAttr, ActiveLevels &&);
70 void preComponentVisitUpdate();
71 void postComponentVisitUpdate(ActiveLevels &);
74 void insertCacheCleanUp(mlir::Type type, int32_t depth);
75 void cleanUpCache(int32_t depth);
77 int32_t derivedTypeDepth = 0;
85 llvm::DenseMap<mlir::Type, std::pair<mlir::LLVM::DITypeAttr, ActiveLevels>>
89 ActiveLevels componentActiveRecursionLevels;
97class DebugTypeGenerator {
99 DebugTypeGenerator(mlir::ModuleOp module, mlir::SymbolTable *symbolTable,
100 const mlir::DataLayout &dl);
102 mlir::LLVM::DITypeAttr convertType(mlir::Type Ty,
103 mlir::LLVM::DIFileAttr fileAttr,
104 mlir::LLVM::DIScopeAttr scope,
105 fir::cg::XDeclareOp declOp);
108 mlir::LLVM::DITypeAttr convertRecordType(fir::RecordType Ty,
109 mlir::LLVM::DIFileAttr fileAttr,
110 mlir::LLVM::DIScopeAttr scope,
111 fir::cg::XDeclareOp declOp);
112 mlir::LLVM::DITypeAttr convertTupleType(mlir::TupleType Ty,
113 mlir::LLVM::DIFileAttr fileAttr,
114 mlir::LLVM::DIScopeAttr scope,
115 fir::cg::XDeclareOp declOp);
116 mlir::LLVM::DITypeAttr convertSequenceType(fir::SequenceType seqTy,
117 mlir::LLVM::DIFileAttr fileAttr,
118 mlir::LLVM::DIScopeAttr scope,
119 fir::cg::XDeclareOp declOp);
120 mlir::LLVM::DITypeAttr convertVectorType(fir::VectorType vecTy,
121 mlir::LLVM::DIFileAttr fileAttr,
122 mlir::LLVM::DIScopeAttr scope,
123 fir::cg::XDeclareOp declOp);
129 mlir::LLVM::DITypeAttr convertBoxedSequenceType(
130 fir::SequenceType seqTy, mlir::LLVM::DIFileAttr fileAttr,
131 mlir::LLVM::DIScopeAttr scope, fir::cg::XDeclareOp declOp,
132 bool genAllocated,
bool genAssociated);
133 mlir::LLVM::DITypeAttr convertCharacterType(fir::CharacterType charTy,
134 mlir::LLVM::DIFileAttr fileAttr,
135 mlir::LLVM::DIScopeAttr scope,
136 fir::cg::XDeclareOp declOp,
138 bool genStringLocation =
true);
140 mlir::LLVM::DITypeAttr convertPointerLikeType(mlir::Type elTy,
141 mlir::LLVM::DIFileAttr fileAttr,
142 mlir::LLVM::DIScopeAttr scope,
143 fir::cg::XDeclareOp declOp,
146 mlir::LLVM::DILocalVariableAttr
147 generateArtificialVariable(mlir::MLIRContext *context, mlir::Value Val,
148 mlir::LLVM::DIFileAttr fileAttr,
149 mlir::LLVM::DIScopeAttr scope,
150 fir::cg::XDeclareOp declOp);
151 std::pair<std::uint64_t, unsigned short>
152 getFieldSizeAndAlign(mlir::Type fieldTy);
154 mlir::ModuleOp module;
155 mlir::SymbolTable *symbolTable;
156 const mlir::DataLayout *dataLayout;
159 std::uint64_t dimsSize;
160 std::uint64_t dimsOffset;
161 std::uint64_t ptrSize;
162 std::uint64_t lenOffset;
163 std::uint64_t rankOffset;
164 std::uint64_t rankSize;