Skip to content

Commit af017d0

Browse files
committed
rename id to recId
1 parent 87b1db1 commit af017d0

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,25 +313,25 @@ def LLVM_DIRecursiveTypeAttr : LLVM_Attr<"DIRecursiveType", "di_recursive_type",
313313

314314
1. If `baseType` is present:
315315
- This type is considered a recursive declaration (rec-decl).
316-
- The `baseType` is a self-recursive type identified by the `id` field.
316+
- The `baseType` is a self-recursive type identified by the `recId` field.
317317

318318
2. If `baseType` is not present:
319319
- This type is considered a recursive self reference (rec-self).
320320
- This DIRecursiveType itself is a placeholder type that should be
321321
conceptually replaced with the closet parent DIRecursiveType with the
322-
same `id` field.
322+
same `recId` field.
323323

324324
e.g. To represent a linked list struct:
325325

326-
#rec_self = di_recursive_type<self_id = 0>
326+
#rec_self = di_recursive_type<recId = 0>
327327
#ptr = di_derived_type<baseType: #rec_self, ...>
328328
#field = di_derived_type<name = "next", baseType: #ptr, ...>
329329
#struct = di_composite_type<name = "Node", elements: #field, ...>
330-
#rec = di_recursive_type<self_id = 0, baseType: #struct>
330+
#rec = di_recursive_type<recId = 0, baseType: #struct>
331331

332332
#var = di_local_variable<type = #struct_type, ...>
333333

334-
Note that a rec-self without an outer rec-decl with the same id is
334+
Note that a rec-self without an outer rec-decl with the same recId is
335335
conceptually the same as an "unbound" variable. The context needs to provide
336336
meaning to the rec-self.
337337

@@ -343,13 +343,13 @@ def LLVM_DIRecursiveTypeAttr : LLVM_Attr<"DIRecursiveType", "di_recursive_type",
343343
}];
344344

345345
let parameters = (ins
346-
"DistinctAttr":$id,
346+
"DistinctAttr":$recId,
347347
OptionalParameter<"DITypeAttr">:$baseType
348348
);
349349

350350
let builders = [
351-
AttrBuilderWithInferredContext<(ins "DistinctAttr":$id), [{
352-
return $_get(id.getContext(), id, nullptr);
351+
AttrBuilderWithInferredContext<(ins "DistinctAttr":$recId), [{
352+
return $_get(recId.getContext(), recId, nullptr);
353353
}]>
354354
];
355355

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ void printExpressionArg(AsmPrinter &printer, uint64_t opcode,
192192

193193
DITypeAttr DIRecursiveTypeAttr::getUnfoldedBaseType() {
194194
assert(!isRecSelf() && "cannot get baseType from a rec-self type");
195-
return cast<DITypeAttr>(getBaseType().replace(
195+
return llvm::cast<DITypeAttr>(getBaseType().replace(
196196
[&](DIRecursiveTypeAttr rec) -> std::optional<DIRecursiveTypeAttr> {
197-
if (rec.getId() == getId())
197+
if (rec.getRecId() == getRecId())
198198
return *this;
199199
return std::nullopt;
200200
}));

mlir/lib/Target/LLVMIR/DebugTranslation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ DebugTranslation::translateImpl(DIGlobalVariableAttr attr) {
214214
}
215215

216216
llvm::DIType *DebugTranslation::translateImpl(DIRecursiveTypeAttr attr) {
217-
DistinctAttr recursiveId = attr.getId();
217+
DistinctAttr recursiveId = attr.getRecId();
218218
if (attr.isRecSelf()) {
219219
auto *iter = recursiveTypeMap.find(recursiveId);
220220
assert(iter != recursiveTypeMap.end() && "unbound DI recursive self type");

0 commit comments

Comments
 (0)