67 mlir::LLVM::DITypeAttr lookup(mlir::Type);
68 ActiveLevels startTranslating(mlir::Type,
69 mlir::LLVM::DITypeAttr placeHolder =
nullptr);
70 void finalize(mlir::Type, mlir::LLVM::DITypeAttr, ActiveLevels &&);
71 void preComponentVisitUpdate();
72 void postComponentVisitUpdate(ActiveLevels &);
75 void insertCacheCleanUp(mlir::Type type, int32_t depth);
76 void cleanUpCache(int32_t depth);
78 int32_t derivedTypeDepth = 0;
86 llvm::DenseMap<mlir::Type, std::pair<mlir::LLVM::DITypeAttr, ActiveLevels>>
90 ActiveLevels componentActiveRecursionLevels;
98class DebugTypeGenerator {
105 DebugTypeGenerator(mlir::ModuleOp module, mlir::SymbolTable *symbolTable,
106 const mlir::DataLayout &dl,
107 bool boundsInStackSlots =
false,
110 mlir::LLVM::DITypeAttr convertType(mlir::Type Ty,
111 mlir::LLVM::DIFileAttr fileAttr,
112 mlir::LLVM::DIScopeAttr scope,
113 fir::cg::XDeclareOp declOp);
117 bool hasBoundSlot(mlir::Value val, fir::cg::XDeclareOp declOp)
const;
120 mlir::LLVM::DITypeAttr convertRecordType(fir::RecordType Ty,
121 mlir::LLVM::DIFileAttr fileAttr,
122 mlir::LLVM::DIScopeAttr scope,
123 fir::cg::XDeclareOp declOp);
124 mlir::LLVM::DITypeAttr convertTupleType(mlir::TupleType Ty,
125 mlir::LLVM::DIFileAttr fileAttr,
126 mlir::LLVM::DIScopeAttr scope,
127 fir::cg::XDeclareOp declOp);
128 mlir::LLVM::DITypeAttr convertSequenceType(fir::SequenceType seqTy,
129 mlir::LLVM::DIFileAttr fileAttr,
130 mlir::LLVM::DIScopeAttr scope,
131 fir::cg::XDeclareOp declOp);
132 mlir::LLVM::DITypeAttr convertVectorType(fir::VectorType vecTy,
133 mlir::LLVM::DIFileAttr fileAttr,
134 mlir::LLVM::DIScopeAttr scope,
135 fir::cg::XDeclareOp declOp);
141 mlir::LLVM::DITypeAttr convertBoxedSequenceType(
142 fir::SequenceType seqTy, mlir::LLVM::DIFileAttr fileAttr,
143 mlir::LLVM::DIScopeAttr scope, fir::cg::XDeclareOp declOp,
144 bool genAllocated,
bool genAssociated);
145 mlir::LLVM::DITypeAttr convertCharacterType(fir::CharacterType charTy,
146 mlir::LLVM::DIFileAttr fileAttr,
147 mlir::LLVM::DIScopeAttr scope,
148 fir::cg::XDeclareOp declOp,
150 bool genStringLocation =
true);
152 mlir::LLVM::DITypeAttr convertPointerLikeType(mlir::Type elTy,
153 mlir::LLVM::DIFileAttr fileAttr,
154 mlir::LLVM::DIScopeAttr scope,
155 fir::cg::XDeclareOp declOp,
158 mlir::LLVM::DILocalVariableAttr
159 generateArtificialVariable(mlir::MLIRContext *context, mlir::Value Val,
160 mlir::LLVM::DIFileAttr fileAttr,
161 mlir::LLVM::DIScopeAttr scope,
162 fir::cg::XDeclareOp declOp);
163 std::pair<std::uint64_t, unsigned short>
164 getFieldSizeAndAlign(mlir::Type fieldTy);
166 mlir::ModuleOp module;
167 mlir::SymbolTable *symbolTable;
168 const mlir::DataLayout *dataLayout;
169 bool boundsInStackSlots;
170 struct ArtificialVar {
173 mlir::LLVM::DILocalVariableAttr var;
177 llvm::DenseMap<std::pair<mlir::Value, mlir::Operation *>, ArtificialVar>
179 KindMapping kindMapping;
182 std::uint64_t dimsSize;
183 std::uint64_t dimsOffset;
184 std::uint64_t ptrSize;
185 std::uint64_t lenOffset;
186 std::uint64_t rankOffset;
187 std::uint64_t rankSize;
188 DerivedTypeCache derivedTypeCache;