@@ -199,29 +199,39 @@ def CIR_TypeSizeInfoAttr : CIR_Attr<"TypeSizeInfo", "type_size_info"> {
199
199
}];
200
200
201
201
let extraClassDeclaration = [{
202
- unsigned getPointerSize() const { return getSizeTSize(); }
202
+ unsigned getPointerSize() const;
203
+ mlir::Type getCharType(mlir::MLIRContext *ctx) const;
204
+ mlir::Type getUCharType(mlir::MLIRContext *ctx) const;
205
+ mlir::Type getIntType(mlir::MLIRContext *ctx) const;
206
+ mlir::Type getUIntType(mlir::MLIRContext *ctx) const;
207
+ mlir::Type getSizeType(mlir::MLIRContext *ctx) const;
208
+ mlir::Type getPtrDiffType(mlir::MLIRContext *ctx) const;
209
+ }];
210
+
211
+ let extraClassDefinition = [{
212
+ unsigned $cppClass::getPointerSize() const { return getSizeTSize(); }
203
213
204
- mlir::Type getCharType(mlir::MLIRContext *ctx) const {
214
+ mlir::Type $cppClass:: getCharType(mlir::MLIRContext *ctx) const {
205
215
return cir::IntType::get(ctx, getCharSize(), /*signed=*/true);
206
216
}
207
217
208
- mlir::Type getUCharType(mlir::MLIRContext *ctx) const {
218
+ mlir::Type $cppClass:: getUCharType(mlir::MLIRContext *ctx) const {
209
219
return cir::IntType::get(ctx, getCharSize(), /*signed=*/false);
210
220
}
211
221
212
- mlir::Type getIntType(mlir::MLIRContext *ctx) const {
222
+ mlir::Type $cppClass:: getIntType(mlir::MLIRContext *ctx) const {
213
223
return cir::IntType::get(ctx, getIntSize(), /*signed=*/true);
214
224
}
215
225
216
- mlir::Type getUIntType(mlir::MLIRContext *ctx) const {
226
+ mlir::Type $cppClass:: getUIntType(mlir::MLIRContext *ctx) const {
217
227
return cir::IntType::get(ctx, getIntSize(), /*signed=*/false);
218
228
}
219
229
220
- mlir::Type getSizeType(mlir::MLIRContext *ctx) const {
230
+ mlir::Type $cppClass:: getSizeType(mlir::MLIRContext *ctx) const {
221
231
return cir::IntType::get(ctx, getSizeTSize(), /*signed=*/false);
222
232
}
223
233
224
- mlir::Type getPtrDiffType(mlir::MLIRContext *ctx) const {
234
+ mlir::Type $cppClass:: getPtrDiffType(mlir::MLIRContext *ctx) const {
225
235
return cir::IntType::get(ctx, getSizeTSize(), /*signed=*/true);
226
236
}
227
237
}];
0 commit comments