Skip to content

Commit 71a404e

Browse files
committed
Rename CommentIndex -> LineStartIndex, comment index-related members
1 parent 1892e3f commit 71a404e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

llvm/utils/TableGen/DecoderTableEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ unsigned DecoderTableEmitter::computeTableSize(const DecoderTreeNode *Root,
132132
}
133133

134134
void DecoderTableEmitter::emitStartLine() {
135-
CommentIndex = CurrentIndex;
135+
LineStartIndex = CurrentIndex;
136136
OS.indent(2);
137137
}
138138

@@ -165,7 +165,7 @@ raw_ostream &DecoderTableEmitter::emitComment(indent Indent) {
165165
if (OS.getColumn() > CommentColumn)
166166
OS << '\n';
167167
OS.PadToColumn(CommentColumn);
168-
OS << "// " << format_decimal(CommentIndex, IndexWidth) << ": " << Indent;
168+
OS << "// " << format_decimal(LineStartIndex, IndexWidth) << ": " << Indent;
169169
return OS;
170170
}
171171

llvm/utils/TableGen/DecoderTableEmitter.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,18 @@ struct DecoderTableInfo {
4949
class DecoderTableEmitter {
5050
DecoderTableInfo &TableInfo;
5151
formatted_raw_ostream OS;
52+
53+
/// The number of positions occupied by the index in the output. Used to
54+
/// right-align indices and left-align the text that follows them.
5255
unsigned IndexWidth;
56+
57+
/// The current position in the output stream. After the table is emitted,
58+
/// this is its size.
5359
unsigned CurrentIndex;
54-
unsigned CommentIndex;
60+
61+
/// The index of the first byte of the table row. Used as a label in the
62+
/// comment following the row.
63+
unsigned LineStartIndex;
5564

5665
public:
5766
DecoderTableEmitter(DecoderTableInfo &TableInfo, raw_ostream &OS)

0 commit comments

Comments
 (0)