Skip to content

Commit 988d78e

Browse files
committed
Address comments.
1 parent c6ed8b2 commit 988d78e

File tree

12 files changed

+104
-92
lines changed

12 files changed

+104
-92
lines changed

flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertBoxedSequenceType(
146146
elements.push_back(subrangeTy);
147147
}
148148
return mlir::LLVM::DICompositeTypeAttr::get(
149-
context, llvm::dwarf::DW_TAG_array_type, /*recursive_id=*/{},
150-
/*name=*/nullptr, /*file=*/nullptr, /*line=*/0, /*scope=*/nullptr, elemTy,
149+
context, llvm::dwarf::DW_TAG_array_type, /*name=*/nullptr,
150+
/*file=*/nullptr, /*line=*/0, /*scope=*/nullptr, elemTy,
151151
mlir::LLVM::DIFlags::Zero, /*sizeInBits=*/0, /*alignInBits=*/0, elements,
152152
dataLocation, /*rank=*/nullptr, allocated, associated);
153153
}
@@ -188,7 +188,7 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertRecordType(
188188
}
189189

190190
return mlir::LLVM::DICompositeTypeAttr::get(
191-
context, llvm::dwarf::DW_TAG_structure_type, /*recursive_id=*/{},
191+
context, llvm::dwarf::DW_TAG_structure_type,
192192
mlir::StringAttr::get(context, result.second.name), fileAttr, line, scope,
193193
/*baseType=*/nullptr, mlir::LLVM::DIFlags::Zero, offset * 8,
194194
/*alignInBits=*/0, elements, /*dataLocation=*/nullptr, /*rank=*/nullptr,
@@ -236,8 +236,8 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertSequenceType(
236236
// have been set to some valid default values.
237237

238238
return mlir::LLVM::DICompositeTypeAttr::get(
239-
context, llvm::dwarf::DW_TAG_array_type, /*recursive_id=*/{},
240-
/*name=*/nullptr, /*file=*/nullptr, /*line=*/0, /*scope=*/nullptr, elemTy,
239+
context, llvm::dwarf::DW_TAG_array_type, /*name=*/nullptr,
240+
/*file=*/nullptr, /*line=*/0, /*scope=*/nullptr, elemTy,
241241
mlir::LLVM::DIFlags::Zero, /*sizeInBits=*/0, /*alignInBits=*/0, elements,
242242
/*dataLocation=*/nullptr, /*rank=*/nullptr, /*allocated=*/nullptr,
243243
/*associated=*/nullptr);

mlir/include/mlir-c/Dialect/LLVM.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,12 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIBasicTypeAttrGet(
235235
MlirLLVMTypeEncoding encoding);
236236

237237
/// Creates a self-referencing LLVM DICompositeType attribute.
238-
MlirAttribute mlirLLVMDICompositeTypeAttrGetSelfRec(MlirAttribute recId);
238+
MlirAttribute mlirLLVMDICompositeTypeAttrGetRecSelf(MlirAttribute recId);
239239

240240
/// Creates a LLVM DICompositeType attribute.
241241
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDICompositeTypeAttrGet(
242-
MlirContext ctx, unsigned int tag, MlirAttribute recId, MlirAttribute name,
243-
MlirAttribute file, uint32_t line, MlirAttribute scope,
242+
MlirContext ctx, MlirAttribute recId, bool isRecSelf, unsigned int tag,
243+
MlirAttribute name, MlirAttribute file, uint32_t line, MlirAttribute scope,
244244
MlirAttribute baseType, int64_t flags, uint64_t sizeInBits,
245245
uint64_t alignInBits, intptr_t nElements, MlirAttribute const *elements,
246246
MlirAttribute dataLocation, MlirAttribute rank, MlirAttribute allocated,
@@ -315,11 +315,11 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDILocalVariableAttrGet(
315315
unsigned int alignInBits, MlirAttribute diType, int64_t flags);
316316

317317
/// Creates a self-referencing LLVM DISubprogramAttr attribute.
318-
MlirAttribute mlirLLVMDISubprogramAttrGetSelfRec(MlirAttribute recId);
318+
MlirAttribute mlirLLVMDISubprogramAttrGetRecSelf(MlirAttribute recId);
319319

320320
/// Creates a LLVM DISubprogramAttr attribute.
321321
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGet(
322-
MlirContext ctx, MlirAttribute id, MlirAttribute recId,
322+
MlirContext ctx, MlirAttribute recId, bool isRecSelf, MlirAttribute id,
323323
MlirAttribute compileUnit, MlirAttribute scope, MlirAttribute name,
324324
MlirAttribute linkageName, MlirAttribute file, unsigned int line,
325325
unsigned int scopeLine, uint64_t subprogramFlags, MlirAttribute type,

mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td

+30-17
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def LLVM_DILanguageParameter : LLVM_DIParameter<
271271
>;
272272

273273
def LLVM_DITagParameter : LLVM_DIParameter<
274-
"tag", /*default=*/"", "Tag", /*errorCase=*/"llvm::dwarf::DW_TAG_invalid"
274+
"tag", /*default=*/"0", "Tag", /*errorCase=*/"llvm::dwarf::DW_TAG_invalid"
275275
>;
276276

277277
def LLVM_DIOperationEncodingParameter : LLVM_DIParameter<
@@ -375,14 +375,17 @@ def LLVM_DICompositeTypeAttr : LLVM_Attr<"DICompositeType", "di_composite_type",
375375
[LLVM_DIRecursiveTypeAttrInterface],
376376
"DITypeAttr"> {
377377
let parameters = (ins
378-
LLVM_DITagParameter:$tag,
378+
// DIRecursiveTypeAttrInterface specific parameters.
379379
OptionalParameter<"DistinctAttr">:$recId,
380+
OptionalParameter<"bool">:$isRecSelf,
381+
// DICompositeType specific parameters.
382+
LLVM_DITagParameter:$tag,
380383
OptionalParameter<"StringAttr">:$name,
381384
OptionalParameter<"DIFileAttr">:$file,
382385
OptionalParameter<"uint32_t">:$line,
383386
OptionalParameter<"DIScopeAttr">:$scope,
384387
OptionalParameter<"DITypeAttr">:$baseType,
385-
OptionalParameter<"DIFlags", "DIFlags::Zero">:$flags,
388+
OptionalParameter<"DIFlags">:$flags,
386389
OptionalParameter<"uint64_t">:$sizeInBits,
387390
OptionalParameter<"uint64_t">:$alignInBits,
388391
OptionalArrayRefParameter<"DINodeAttr">:$elements,
@@ -391,14 +394,26 @@ def LLVM_DICompositeTypeAttr : LLVM_Attr<"DICompositeType", "di_composite_type",
391394
OptionalParameter<"DIExpressionAttr">:$allocated,
392395
OptionalParameter<"DIExpressionAttr">:$associated
393396
);
397+
let builders = [
398+
AttrBuilder<(ins
399+
"unsigned":$tag, "StringAttr":$name, "DIFileAttr":$file,
400+
"uint32_t":$line, "DIScopeAttr":$scope, "DITypeAttr":$baseType,
401+
"DIFlags":$flags, "uint64_t":$sizeInBits, "uint64_t":$alignInBits,
402+
"ArrayRef<DINodeAttr>":$elements, "DIExpressionAttr":$dataLocation,
403+
"DIExpressionAttr":$rank, "DIExpressionAttr":$allocated,
404+
"DIExpressionAttr":$associated
405+
), [{
406+
return $_get($_ctxt, /*recId=*/nullptr, /*isRecSelf=*/nullptr,
407+
tag, name, file, line, scope, baseType, flags, sizeInBits,
408+
alignInBits, elements, dataLocation, rank, allocated,
409+
associated);
410+
}]>
411+
];
394412
let assemblyFormat = "`<` struct(params) `>`";
395413
let extraClassDeclaration = [{
396414
/// Requirements of DIRecursiveTypeAttrInterface.
397415
/// @{
398416

399-
/// Get whether this attr describes a recursive self reference.
400-
bool isRecSelf() { return getTag() == 0; }
401-
402417
/// Get a copy of this type attr but with the recursive ID set to `recId`.
403418
DIRecursiveTypeAttrInterface withRecId(DistinctAttr recId);
404419

@@ -557,8 +572,11 @@ def LLVM_DISubprogramAttr : LLVM_Attr<"DISubprogram", "di_subprogram",
557572
[LLVM_DIRecursiveTypeAttrInterface],
558573
"DIScopeAttr"> {
559574
let parameters = (ins
560-
OptionalParameter<"DistinctAttr">:$id,
575+
// DIRecursiveTypeAttrInterface specific parameters.
561576
OptionalParameter<"DistinctAttr">:$recId,
577+
OptionalParameter<"bool">:$isRecSelf,
578+
// DISubprogramAttr specific parameters.
579+
OptionalParameter<"DistinctAttr">:$id,
562580
OptionalParameter<"DICompileUnitAttr">:$compileUnit,
563581
OptionalParameter<"DIScopeAttr">:$scope,
564582
OptionalParameter<"StringAttr">:$name,
@@ -571,28 +589,23 @@ def LLVM_DISubprogramAttr : LLVM_Attr<"DISubprogram", "di_subprogram",
571589
OptionalArrayRefParameter<"DINodeAttr">:$retainedNodes
572590
);
573591
let builders = [
574-
AttrBuilderWithInferredContext<(ins
592+
AttrBuilder<(ins
575593
"DistinctAttr":$id, "DICompileUnitAttr":$compileUnit,
576-
"DIScopeAttr":$scope, "StringRef":$name, "StringRef":$linkageName,
594+
"DIScopeAttr":$scope, "StringAttr":$name, "StringAttr":$linkageName,
577595
"DIFileAttr":$file, "unsigned":$line, "unsigned":$scopeLine,
578596
"DISubprogramFlags":$subprogramFlags, "DISubroutineTypeAttr":$type,
579597
"ArrayRef<DINodeAttr>":$retainedNodes
580598
), [{
581-
MLIRContext *ctx = file.getContext();
582-
return $_get(ctx, id, /*recId=*/nullptr, compileUnit, scope,
583-
StringAttr::get(ctx, name),
584-
StringAttr::get(ctx, linkageName), file, line,
585-
scopeLine, subprogramFlags, type, retainedNodes);
599+
return $_get($_ctxt, /*recId=*/nullptr, /*isRecSelf=*/false, id, compileUnit,
600+
scope, name, linkageName, file, line, scopeLine,
601+
subprogramFlags, type, retainedNodes);
586602
}]>
587603
];
588604
let assemblyFormat = "`<` struct(params) `>`";
589605
let extraClassDeclaration = [{
590606
/// Requirements of DIRecursiveTypeAttrInterface.
591607
/// @{
592608

593-
/// Get whether this attr describes a recursive self reference.
594-
bool isRecSelf() { return !getScope(); }
595-
596609
/// Get a copy of this type attr but with the recursive ID set to `recId`.
597610
DIRecursiveTypeAttrInterface withRecId(DistinctAttr recId);
598611

mlir/include/mlir/Dialect/LLVMIR/LLVMInterfaces.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def LLVM_DIRecursiveTypeAttrInterface
406406
let methods = [
407407
InterfaceMethod<[{
408408
Get whether this attr describes a recursive self reference.
409-
}], "bool", "isRecSelf", (ins)>,
409+
}], "bool", "getIsRecSelf", (ins)>,
410410
InterfaceMethod<[{
411411
Get the recursive ID used for matching "rec-decl" with "rec-self".
412412
If this attr instance is not recursive, return a null attribute.

mlir/lib/CAPI/Dialect/LLVM.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ MlirAttribute mlirLLVMDIBasicTypeAttrGet(MlirContext ctx, unsigned int tag,
159159
unwrap(ctx), tag, cast<StringAttr>(unwrap(name)), sizeInBits, encoding));
160160
}
161161

162-
MlirAttribute mlirLLVMDICompositeTypeAttrGetSelfRec(MlirAttribute recId) {
162+
MlirAttribute mlirLLVMDICompositeTypeAttrGetRecSelf(MlirAttribute recId) {
163163
return wrap(
164164
DICompositeTypeAttr::getRecSelf(cast<DistinctAttr>(unwrap(recId))));
165165
}
166166

167167
MlirAttribute mlirLLVMDICompositeTypeAttrGet(
168-
MlirContext ctx, unsigned int tag, MlirAttribute recId, MlirAttribute name,
169-
MlirAttribute file, uint32_t line, MlirAttribute scope,
168+
MlirContext ctx, MlirAttribute recId, bool isRecSelf, unsigned int tag,
169+
MlirAttribute name, MlirAttribute file, uint32_t line, MlirAttribute scope,
170170
MlirAttribute baseType, int64_t flags, uint64_t sizeInBits,
171171
uint64_t alignInBits, intptr_t nElements, MlirAttribute const *elements,
172172
MlirAttribute dataLocation, MlirAttribute rank, MlirAttribute allocated,
@@ -175,7 +175,7 @@ MlirAttribute mlirLLVMDICompositeTypeAttrGet(
175175
elementsStorage.reserve(nElements);
176176

177177
return wrap(DICompositeTypeAttr::get(
178-
unwrap(ctx), tag, cast<DistinctAttr>(unwrap(recId)),
178+
unwrap(ctx), cast<DistinctAttr>(unwrap(recId)), isRecSelf, tag,
179179
cast<StringAttr>(unwrap(name)), cast<DIFileAttr>(unwrap(file)), line,
180180
cast<DIScopeAttr>(unwrap(scope)), cast<DITypeAttr>(unwrap(baseType)),
181181
DIFlags(flags), sizeInBits, alignInBits,
@@ -294,21 +294,21 @@ MlirAttribute mlirLLVMDISubroutineTypeAttrGet(MlirContext ctx,
294294
[](Attribute a) { return cast<DITypeAttr>(a); })));
295295
}
296296

297-
MlirAttribute mlirLLVMDISubprogramAttrGetSelfRec(MlirAttribute recId) {
297+
MlirAttribute mlirLLVMDISubprogramAttrGetRecSelf(MlirAttribute recId) {
298298
return wrap(DISubprogramAttr::getRecSelf(cast<DistinctAttr>(unwrap(recId))));
299299
}
300300

301301
MlirAttribute mlirLLVMDISubprogramAttrGet(
302-
MlirContext ctx, MlirAttribute id, MlirAttribute recId,
302+
MlirContext ctx, MlirAttribute recId, bool isRecSelf, MlirAttribute id,
303303
MlirAttribute compileUnit, MlirAttribute scope, MlirAttribute name,
304304
MlirAttribute linkageName, MlirAttribute file, unsigned int line,
305305
unsigned int scopeLine, uint64_t subprogramFlags, MlirAttribute type,
306306
intptr_t nRetainedNodes, MlirAttribute const *retainedNodes) {
307307
SmallVector<Attribute> nodesStorage;
308308
nodesStorage.reserve(nRetainedNodes);
309309
return wrap(DISubprogramAttr::get(
310-
unwrap(ctx), cast<DistinctAttr>(unwrap(id)),
311-
cast<DistinctAttr>(unwrap(recId)),
310+
unwrap(ctx), cast<DistinctAttr>(unwrap(recId)), isRecSelf,
311+
cast<DistinctAttr>(unwrap(id)),
312312
cast<DICompileUnitAttr>(unwrap(compileUnit)),
313313
cast<DIScopeAttr>(unwrap(scope)), cast<StringAttr>(unwrap(name)),
314314
cast<StringAttr>(unwrap(linkageName)), cast<DIFileAttr>(unwrap(file)),

mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp

+12-11
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,17 @@ void printExpressionArg(AsmPrinter &printer, uint64_t opcode,
203203
DIRecursiveTypeAttrInterface
204204
DICompositeTypeAttr::withRecId(DistinctAttr recId) {
205205
return DICompositeTypeAttr::get(
206-
getContext(), getTag(), recId, getName(), getFile(), getLine(),
207-
getScope(), getBaseType(), getFlags(), getSizeInBits(), getAlignInBits(),
208-
getElements(), getDataLocation(), getRank(), getAllocated(),
209-
getAssociated());
206+
getContext(), recId, /*isRecSelf=*/false, getTag(), getName(), getFile(),
207+
getLine(), getScope(), getBaseType(), getFlags(), getSizeInBits(),
208+
getAlignInBits(), getElements(), getDataLocation(), getRank(),
209+
getAllocated(), getAssociated());
210210
}
211211

212212
DIRecursiveTypeAttrInterface
213213
DICompositeTypeAttr::getRecSelf(DistinctAttr recId) {
214-
return DICompositeTypeAttr::get(recId.getContext(), 0, recId, {}, {}, 0, {},
215-
{}, DIFlags(), 0, 0, {}, {}, {}, {}, {});
214+
return DICompositeTypeAttr::get(recId.getContext(), recId, /*isRecSelf=*/true,
215+
0, {}, {}, 0, {}, {}, DIFlags(), 0, 0, {}, {},
216+
{}, {}, {});
216217
}
217218

218219
//===----------------------------------------------------------------------===//
@@ -221,14 +222,14 @@ DICompositeTypeAttr::getRecSelf(DistinctAttr recId) {
221222

222223
DIRecursiveTypeAttrInterface DISubprogramAttr::withRecId(DistinctAttr recId) {
223224
return DISubprogramAttr::get(
224-
getContext(), getId(), recId, getCompileUnit(), getScope(), getName(),
225-
getLinkageName(), getFile(), getLine(), getScopeLine(),
226-
getSubprogramFlags(), getType(), getRetainedNodes());
225+
getContext(), recId, /*isRecSelf=*/false, getId(), getCompileUnit(),
226+
getScope(), getName(), getLinkageName(), getFile(), getLine(),
227+
getScopeLine(), getSubprogramFlags(), getType(), getRetainedNodes());
227228
}
228229

229230
DIRecursiveTypeAttrInterface DISubprogramAttr::getRecSelf(DistinctAttr recId) {
230-
return DISubprogramAttr::get(recId.getContext(), {}, recId, {}, {}, {}, {}, 0,
231-
0, {}, {}, {}, {});
231+
return DISubprogramAttr::get(recId.getContext(), recId, /*isRecSelf=*/true,
232+
{}, {}, {}, {}, {}, 0, 0, {}, {}, {}, {});
232233
}
233234

234235
//===----------------------------------------------------------------------===//

mlir/lib/Dialect/LLVMIR/Transforms/DIScopeForLLVMFuncOp.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ static void addScopeToFunction(LLVM::LLVMFuncOp llvmFunc,
6565
auto subroutineTypeAttr =
6666
LLVM::DISubroutineTypeAttr::get(context, llvm::dwarf::DW_CC_normal, {});
6767

68-
StringAttr funcNameAttr = llvmFunc.getNameAttr();
6968
// Only definitions need a distinct identifier and a compilation unit.
7069
DistinctAttr id;
7170
auto subprogramFlags = LLVM::DISubprogramFlags::Optimized;
@@ -75,11 +74,10 @@ static void addScopeToFunction(LLVM::LLVMFuncOp llvmFunc,
7574
} else {
7675
compileUnitAttr = {};
7776
}
77+
auto funcName = StringAttr::get(context, llvmFunc.getName());
7878
auto subprogramAttr = LLVM::DISubprogramAttr::get(
79-
context, id, /*recId=*/{}, compileUnitAttr, fileAttr, funcNameAttr,
80-
funcNameAttr, fileAttr,
81-
/*line=*/line,
82-
/*scopeline=*/col, subprogramFlags, subroutineTypeAttr,
79+
context, id, compileUnitAttr, fileAttr, funcName, funcName, fileAttr,
80+
/*line=*/line, /*scopeline=*/col, subprogramFlags, subroutineTypeAttr,
8381
/*retainedNodes=*/{});
8482
llvmFunc->setLoc(FusedLoc::get(context, {loc}, subprogramAttr));
8583
}

mlir/lib/Target/LLVMIR/DebugImporter.cpp

+9-10
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ DICompositeTypeAttr DebugImporter::translateImpl(llvm::DICompositeType *node) {
8989
if (node->getTag() == llvm::dwarf::DW_TAG_array_type && !baseType)
9090
return nullptr;
9191
return DICompositeTypeAttr::get(
92-
context, node->getTag(), /*recId=*/{},
93-
getStringAttrOrNull(node->getRawName()), translate(node->getFile()),
94-
node->getLine(), translate(node->getScope()), baseType,
95-
flags.value_or(DIFlags::Zero), node->getSizeInBits(),
92+
context, node->getTag(), getStringAttrOrNull(node->getRawName()),
93+
translate(node->getFile()), node->getLine(), translate(node->getScope()),
94+
baseType, flags.value_or(DIFlags::Zero), node->getSizeInBits(),
9695
node->getAlignInBits(), elements,
9796
translateExpression(node->getDataLocationExp()),
9897
translateExpression(node->getRankExp()),
@@ -246,12 +245,12 @@ DISubprogramAttr DebugImporter::translateImpl(llvm::DISubprogram *node) {
246245
if (llvm::is_contained(retainedNodes, nullptr))
247246
retainedNodes.clear();
248247

249-
return DISubprogramAttr::get(
250-
context, id, /*recId=*/{}, translate(node->getUnit()), scope,
251-
getStringAttrOrNull(node->getRawName()),
252-
getStringAttrOrNull(node->getRawLinkageName()),
253-
translate(node->getFile()), node->getLine(), node->getScopeLine(),
254-
*subprogramFlags, type, retainedNodes);
248+
return DISubprogramAttr::get(context, id, translate(node->getUnit()), scope,
249+
getStringAttrOrNull(node->getRawName()),
250+
getStringAttrOrNull(node->getRawLinkageName()),
251+
translate(node->getFile()), node->getLine(),
252+
node->getScopeLine(), *subprogramFlags, type,
253+
retainedNodes);
255254
}
256255

257256
DISubrangeAttr DebugImporter::translateImpl(llvm::DISubrange *node) {

mlir/lib/Target/LLVMIR/DebugTranslation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ DebugTranslation::translateRecursive(DIRecursiveTypeAttrInterface attr) {
267267
iter != recursiveNodeMap.end()) {
268268
return iter->second;
269269
}
270-
assert(!attr.isRecSelf() && "unbound DI recursive self reference");
270+
assert(!attr.getIsRecSelf() && "unbound DI recursive self reference");
271271

272272
auto setRecursivePlaceholder = [&](llvm::DINode *placeholder) {
273273
recursiveNodeMap.try_emplace(recursiveId, placeholder);

mlir/test/CAPI/llvm.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static void testDebugInfoAttributes(MlirContext ctx) {
257257
// CHECK: #llvm.di_null_type
258258
mlirAttributeDump(mlirLLVMDINullTypeAttrGet(ctx));
259259

260-
// CHECK: #llvm.di_basic_type<tag = DW_TAG_null, name = "foo", sizeInBits =
260+
// CHECK: #llvm.di_basic_type<name = "foo", sizeInBits =
261261
// CHECK-SAME: 64, encoding = DW_ATE_signed>
262262
MlirAttribute di_type =
263263
mlirLLVMDIBasicTypeAttrGet(ctx, 0, foo, 64, MlirLLVMTypeEncodingSigned);
@@ -317,16 +317,16 @@ static void testDebugInfoAttributes(MlirContext ctx) {
317317
mlirAttributeDump(subroutine_type);
318318

319319
MlirAttribute di_subprogram_self_rec =
320-
mlirLLVMDISubprogramAttrGetSelfRec(recId0);
320+
mlirLLVMDISubprogramAttrGetRecSelf(recId0);
321321
MlirAttribute di_imported_entity = mlirLLVMDIImportedEntityAttrGet(
322322
ctx, 0, di_subprogram_self_rec, di_module, file, 1, foo, 1, &local_var);
323323

324324
mlirAttributeDump(di_imported_entity);
325325
// CHECK: #llvm.di_imported_entity<{{.*}}>
326326

327327
MlirAttribute di_subprogram = mlirLLVMDISubprogramAttrGet(
328-
ctx, id, recId0, compile_unit, compile_unit, foo, bar, file, 1, 2, 0,
329-
subroutine_type, 1, &di_imported_entity);
328+
ctx, recId0, false, id, compile_unit, compile_unit, foo, bar, file, 1, 2,
329+
0, subroutine_type, 1, &di_imported_entity);
330330
// CHECK: #llvm.di_subprogram<{{.*}}>
331331
mlirAttributeDump(di_subprogram);
332332

@@ -356,12 +356,12 @@ static void testDebugInfoAttributes(MlirContext ctx) {
356356
// CHECK: #llvm.di_string_type<{{.*}}>
357357
mlirAttributeDump(string_type);
358358

359-
// CHECK: #llvm.di_composite_type<tag = DW_TAG_null, recId = {{.*}}>
360-
mlirAttributeDump(mlirLLVMDICompositeTypeAttrGetSelfRec(recId1));
359+
// CHECK: #llvm.di_composite_type<recId = {{.*}}, isRecSelf = true>
360+
mlirAttributeDump(mlirLLVMDICompositeTypeAttrGetRecSelf(recId1));
361361

362362
// CHECK: #llvm.di_composite_type<{{.*}}>
363363
mlirAttributeDump(mlirLLVMDICompositeTypeAttrGet(
364-
ctx, 0, recId1, foo, file, 1, compile_unit, di_type, 0, 64, 8, 1,
364+
ctx, recId1, false, 0, foo, file, 1, compile_unit, di_type, 0, 64, 8, 1,
365365
&di_type, expression, expression, expression, expression));
366366
}
367367

0 commit comments

Comments
 (0)