Skip to content

Commit 88250a7

Browse files
zyx-billygysit
andcommitted
Apply suggestions from code review
Co-authored-by: Tobias Gysi <[email protected]>
1 parent 1d85a02 commit 88250a7

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#define LLVMIR_ATTRDEFS
1111

1212
include "mlir/Dialect/LLVMIR/LLVMDialect.td"
13+
include "mlir/Dialect/LLVMIR/LLVMInterfaces.td"
1314
include "mlir/IR/AttrTypeBase.td"
1415
include "mlir/IR/CommonAttrConstraints.td"
15-
include "mlir/Dialect/LLVMIR/LLVMInterfaces.td"
1616

1717
// All of the attributes will extend this class.
1818
class LLVM_Attr<string name, string attrMnemonic,
@@ -386,7 +386,7 @@ def LLVM_DICompositeTypeAttr : LLVM_Attr<"DICompositeType", "di_composite_type",
386386
/// Get a copy of this type attr but with the recursive ID set to `recId`.
387387
DIRecursiveTypeAttrInterface withRecId(DistinctAttr recId);
388388

389-
/// Build a rec-self instance using the provided recId.
389+
/// Build a rec-self instance using the provided `recId`.
390390
static DIRecursiveTypeAttrInterface getRecSelf(DistinctAttr recId);
391391

392392
/// @}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file defines op, type, & attr interfaces for the LLVM dialect in MLIR.
9+
// This file defines interfaces for the LLVM dialect in MLIR.
1010
//
1111
//===----------------------------------------------------------------------===//
1212

@@ -341,10 +341,10 @@ def LLVM_DIRecursiveTypeAttrInterface
341341
replaced with the closest parent attr of the same type with the same
342342
recId.
343343

344-
e.g. To represent a linked list struct:
344+
For example, to represent a linked list struct:
345345

346346
#rec_self = di_composite_type<recId = 0>
347-
#ptr = di_derived_type<baseType: #struct_self, ...>
347+
#ptr = di_derived_type<baseType: #rec_self, ...>
348348
#field = di_derived_type<name = "next", baseType: #ptr, ...>
349349
#rec = di_composite_type<recId = 0, name = "Node", elements: #field, ...>
350350
#var = di_local_variable<type = #rec, ...>

mlir/lib/Target/LLVMIR/DebugImporter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ DINodeAttr DebugImporter::translate(llvm::DINode *node) {
260260
iter->second = recId;
261261
}
262262
unboundRecursiveSelfRefs.back().insert(recId);
263-
264263
return cast<DINodeAttr>(recSelfCtor(recId));
265264
}
266265
}
@@ -393,7 +392,7 @@ DistinctAttr DebugImporter::getOrCreateDistinctID(llvm::DINode *node) {
393392
return id;
394393
}
395394

396-
llvm::function_ref<DIRecursiveTypeAttrInterface(DistinctAttr)>
395+
function_ref<DIRecursiveTypeAttrInterface(DistinctAttr)>
397396
DebugImporter::getRecSelfConstructor(llvm::DINode *node) {
398397
using CtorType =
399398
llvm::function_ref<DIRecursiveTypeAttrInterface(DistinctAttr)>;

mlir/lib/Target/LLVMIR/DebugImporter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ class DebugImporter {
9999

100100
/// A stack that stores the metadata nodes that are being traversed. The stack
101101
/// is used to detect cyclic dependencies during the metadata translation.
102-
/// Nodes are pushed with a null value. If it is ever seen twice, it is given
103-
/// a DistinctAttr ID, indicating that it is a recursive node.
102+
/// A node is pushed with a null value. If it is ever seen twice, it is given
103+
/// a recursive id attribute, indicating that it is a recursive node.
104104
llvm::MapVector<llvm::DINode *, DistinctAttr> translationStack;
105105
/// All the unbound recursive self references in the translation stack.
106106
SmallVector<DenseSet<DistinctAttr>> unboundRecursiveSelfRefs;

mlir/lib/Target/LLVMIR/DebugTranslation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class DebugTranslation {
101101

102102
/// Get a placeholder DICompositeType without recursing into the elements.
103103
llvm::DICompositeType *translateImplGetPlaceholder(DICompositeTypeAttr attr);
104-
/// Fill out the DICompositeType placeholder by recursively translating the
104+
/// Completes the DICompositeType `placeholder` by recursively translating the
105105
/// elements.
106106
void translateImplFillPlaceholder(DICompositeTypeAttr attr,
107107
llvm::DICompositeType *placeholder);

0 commit comments

Comments
 (0)