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,
101 bool boundsInStackSlots =
false);
103 mlir::LLVM::DITypeAttr convertType(mlir::Type Ty,
104 mlir::LLVM::DIFileAttr fileAttr,
105 mlir::LLVM::DIScopeAttr scope,
106 fir::cg::XDeclareOp declOp);
110 bool hasBoundSlot(mlir::Value val, fir::cg::XDeclareOp declOp)
const;
113 mlir::LLVM::DITypeAttr convertRecordType(fir::RecordType Ty,
114 mlir::LLVM::DIFileAttr fileAttr,
115 mlir::LLVM::DIScopeAttr scope,
116 fir::cg::XDeclareOp declOp);
117 mlir::LLVM::DITypeAttr convertTupleType(mlir::TupleType Ty,
118 mlir::LLVM::DIFileAttr fileAttr,
119 mlir::LLVM::DIScopeAttr scope,
120 fir::cg::XDeclareOp declOp);
121 mlir::LLVM::DITypeAttr convertSequenceType(fir::SequenceType seqTy,
122 mlir::LLVM::DIFileAttr fileAttr,
123 mlir::LLVM::DIScopeAttr scope,
124 fir::cg::XDeclareOp declOp);
125 mlir::LLVM::DITypeAttr convertVectorType(fir::VectorType vecTy,
126 mlir::LLVM::DIFileAttr fileAttr,
127 mlir::LLVM::DIScopeAttr scope,
128 fir::cg::XDeclareOp declOp);
134 mlir::LLVM::DITypeAttr convertBoxedSequenceType(
135 fir::SequenceType seqTy, mlir::LLVM::DIFileAttr fileAttr,
136 mlir::LLVM::DIScopeAttr scope, fir::cg::XDeclareOp declOp,
137 bool genAllocated,
bool genAssociated);
138 mlir::LLVM::DITypeAttr convertCharacterType(fir::CharacterType charTy,
139 mlir::LLVM::DIFileAttr fileAttr,
140 mlir::LLVM::DIScopeAttr scope,
141 fir::cg::XDeclareOp declOp,
143 bool genStringLocation =
true);
145 mlir::LLVM::DITypeAttr convertPointerLikeType(mlir::Type elTy,
146 mlir::LLVM::DIFileAttr fileAttr,
147 mlir::LLVM::DIScopeAttr scope,
148 fir::cg::XDeclareOp declOp,
151 mlir::LLVM::DILocalVariableAttr
152 generateArtificialVariable(mlir::MLIRContext *context, mlir::Value Val,
153 mlir::LLVM::DIFileAttr fileAttr,
154 mlir::LLVM::DIScopeAttr scope,
155 fir::cg::XDeclareOp declOp);
156 std::pair<std::uint64_t, unsigned short>
157 getFieldSizeAndAlign(mlir::Type fieldTy);
159 mlir::ModuleOp module;
160 mlir::SymbolTable *symbolTable;
161 const mlir::DataLayout *dataLayout;
162 bool boundsInStackSlots;
163 struct ArtificialVar {
166 mlir::LLVM::DILocalVariableAttr var;
170 llvm::DenseMap<std::pair<mlir::Value, mlir::Operation *>, ArtificialVar>
174 std::uint64_t dimsSize;
175 std::uint64_t dimsOffset;
176 std::uint64_t ptrSize;
177 std::uint64_t lenOffset;
178 std::uint64_t rankOffset;
179 std::uint64_t rankSize;