Skip to content

Commit e5cd9bd

Browse files
authored
[NFC][TableGen] Delete extra spaces in comments (#147004)
1 parent 79d5db4 commit e5cd9bd

File tree

10 files changed

+96
-98
lines changed

10 files changed

+96
-98
lines changed

llvm/include/llvm/TableGen/Record.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ class UnOpInit final : public OpInit, public FoldingSetNode {
868868
UnaryOp getOpcode() const { return (UnaryOp)Opc; }
869869
const Init *getOperand() const { return LHS; }
870870

871-
// Fold - If possible, fold this to a simpler init. Return this if not
871+
// Fold - If possible, fold this to a simpler init. Return this if not
872872
// possible to fold.
873873
const Init *Fold(const Record *CurRec, bool IsFinal = false) const;
874874

@@ -940,7 +940,7 @@ class BinOpInit final : public OpInit, public FoldingSetNode {
940940
std::optional<bool> CompareInit(unsigned Opc, const Init *LHS,
941941
const Init *RHS) const;
942942

943-
// Fold - If possible, fold this to a simpler init. Return this if not
943+
// Fold - If possible, fold this to a simpler init. Return this if not
944944
// possible to fold.
945945
const Init *Fold(const Record *CurRec) const;
946946

@@ -990,7 +990,7 @@ class TernOpInit final : public OpInit, public FoldingSetNode {
990990
const Init *getMHS() const { return MHS; }
991991
const Init *getRHS() const { return RHS; }
992992

993-
// Fold - If possible, fold this to a simpler init. Return this if not
993+
// Fold - If possible, fold this to a simpler init. Return this if not
994994
// possible to fold.
995995
const Init *Fold(const Record *CurRec) const;
996996

@@ -1096,7 +1096,7 @@ class FoldOpInit final : public TypedInit, public FoldingSetNode {
10961096

10971097
void Profile(FoldingSetNodeID &ID) const;
10981098

1099-
// Fold - If possible, fold this to a simpler init. Return this if not
1099+
// Fold - If possible, fold this to a simpler init. Return this if not
11001100
// possible to fold.
11011101
const Init *Fold(const Record *CurRec) const;
11021102

@@ -1129,7 +1129,7 @@ class IsAOpInit final : public TypedInit, public FoldingSetNode {
11291129

11301130
void Profile(FoldingSetNodeID &ID) const;
11311131

1132-
// Fold - If possible, fold this to a simpler init. Return this if not
1132+
// Fold - If possible, fold this to a simpler init. Return this if not
11331133
// possible to fold.
11341134
const Init *Fold() const;
11351135

@@ -1163,7 +1163,7 @@ class ExistsOpInit final : public TypedInit, public FoldingSetNode {
11631163

11641164
void Profile(FoldingSetNodeID &ID) const;
11651165

1166-
// Fold - If possible, fold this to a simpler init. Return this if not
1166+
// Fold - If possible, fold this to a simpler init. Return this if not
11671167
// possible to fold.
11681168
const Init *Fold(const Record *CurRec, bool IsFinal = false) const;
11691169

@@ -1412,8 +1412,8 @@ class FieldInit final : public TypedInit {
14121412
}
14131413
};
14141414

1415-
/// (v a, b) - Represent a DAG tree value. DAG inits are required
1416-
/// to have at least one value then a (possibly empty) list of arguments. Each
1415+
/// (v a, b) - Represent a DAG tree value. DAG inits are required
1416+
/// to have at least one value then a (possibly empty) list of arguments. Each
14171417
/// argument can have a name associated with it.
14181418
class DagInit final
14191419
: public TypedInit,

llvm/include/llvm/TableGen/SetTheory.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
//
99
// This file implements the SetTheory class that computes ordered sets of
10-
// Records from DAG expressions. Operators for standard set operations are
10+
// Records from DAG expressions. Operators for standard set operations are
1111
// predefined, and it is possible to add special purpose set operators as well.
1212
//
1313
// The user may define named sets as Records of predefined classes. Set
@@ -112,7 +112,7 @@ class SetTheory {
112112
void addExpander(StringRef ClassName, std::unique_ptr<Expander>);
113113

114114
/// addFieldExpander - Add an expander for ClassName that simply evaluates
115-
/// FieldName in the Record to get the set elements. That is all that is
115+
/// FieldName in the Record to get the set elements. That is all that is
116116
/// needed for a class like:
117117
///
118118
/// class Set<dag d> {
@@ -134,7 +134,7 @@ class SetTheory {
134134
evaluate(*begin++, Elts, Loc);
135135
}
136136

137-
/// expand - Expand a record into a set of elements if possible. Return a
137+
/// expand - Expand a record into a set of elements if possible. Return a
138138
/// pointer to the expanded elements, or NULL if Set cannot be expanded
139139
/// further.
140140
const RecVec *expand(const Record *Set);

llvm/include/llvm/TableGen/StringMatcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class raw_ostream;
2626
/// simple switch tree to classify the input string.
2727
///
2828
/// If a match is found, the code in Matches[i].second is executed; control must
29-
/// not exit this code fragment. If nothing matches, execution falls through.
29+
/// not exit this code fragment. If nothing matches, execution falls through.
3030
class StringMatcher {
3131
public:
3232
using StringPair = std::pair<std::string, std::string>;

llvm/lib/TableGen/DetailedRecordsBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===- DetailedRecordBackend.cpp - Detailed Records Report -*- C++ -*-===//
1+
//===- DetailedRecordBackend.cpp - Detailed Records Report ------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This Tablegen backend prints a report that includes all the global
9+
// This Tablegen backend prints a report that includes all the global
1010
// variables, classes, and records in complete detail. It includes more
1111
// detail than the default TableGen printer backend.
1212
//

llvm/lib/TableGen/Main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
// TableGen is a tool which can be used to build up a description of something,
1010
// then invoke one or more "tablegen backends" to emit information about the
11-
// description in some predefined format. In practice, this is used by the LLVM
11+
// description in some predefined format. In practice, this is used by the LLVM
1212
// code generators to automate generation of a code generator through a
1313
// high-level description of the target.
1414
//
@@ -156,7 +156,7 @@ int llvm::TableGenMain(const char *argv0,
156156
return 1;
157157

158158
// Always write the depfile, even if the main output hasn't changed.
159-
// If it's missing, Ninja considers the output dirty. If this was below
159+
// If it's missing, Ninja considers the output dirty. If this was below
160160
// the early exit below and someone deleted the .inc.d file but not the .inc
161161
// file, tablegen would never write the depfile.
162162
if (!DependFilename.empty()) {

llvm/lib/TableGen/Record.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ const Init *BitsInit::convertInitializerTo(const RecTy *Ty) const {
500500
}
501501

502502
if (auto *BRT = dyn_cast<BitsRecTy>(Ty)) {
503-
// If the number of bits is right, return it. Otherwise we need to expand
503+
// If the number of bits is right, return it. Otherwise we need to expand
504504
// or truncate.
505505
if (getNumBits() != BRT->getNumBits()) return nullptr;
506506
return this;
@@ -944,7 +944,7 @@ const Init *UnOpInit::Fold(const Record *CurRec, bool IsFinal) const {
944944
case TAIL:
945945
if (const auto *LHSl = dyn_cast<ListInit>(LHS)) {
946946
assert(!LHSl->empty() && "Empty list in tail");
947-
// Note the slice(1). We can't just pass the result of getElements()
947+
// Note the slice(1). We can't just pass the result of getElements()
948948
// directly.
949949
return ListInit::get(LHSl->getElements().slice(1),
950950
LHSl->getElementType());
@@ -2921,16 +2921,16 @@ void Record::setName(const Init *NewName) {
29212921
Name = NewName;
29222922
checkName();
29232923
// DO NOT resolve record values to the name at this point because
2924-
// there might be default values for arguments of this def. Those
2924+
// there might be default values for arguments of this def. Those
29252925
// arguments might not have been resolved yet so we don't want to
29262926
// prematurely assume values for those arguments were not passed to
29272927
// this def.
29282928
//
29292929
// Nonetheless, it may be that some of this Record's values
2930-
// reference the record name. Indeed, the reason for having the
2931-
// record name be an Init is to provide this flexibility. The extra
2930+
// reference the record name. Indeed, the reason for having the
2931+
// record name be an Init is to provide this flexibility. The extra
29322932
// resolve steps after completely instantiating defs takes care of
2933-
// this. See TGParser::ParseDef and TGParser::ParseDefm.
2933+
// this. See TGParser::ParseDef and TGParser::ParseDefm.
29342934
}
29352935

29362936
void Record::resolveReferences(Resolver &R, const RecordVal *SkipVal) {

llvm/lib/TableGen/TGLexer.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ SMRange TGLexer::getLocRange() const {
102102
}
103103

104104
/// ReturnError - Set the error to the specified string at the specified
105-
/// location. This is defined to always return tgtok::Error.
105+
/// location. This is defined to always return tgtok::Error.
106106
tgtok::TokKind TGLexer::ReturnError(SMLoc Loc, const Twine &Msg) {
107107
PrintError(Loc, Msg);
108108
return tgtok::Error;
@@ -116,7 +116,7 @@ bool TGLexer::processEOF() {
116116
SMLoc ParentIncludeLoc = SrcMgr.getParentIncludeLoc(CurBuffer);
117117
if (ParentIncludeLoc != SMLoc()) {
118118
// If prepExitInclude() detects a problem with the preprocessing
119-
// control stack, it will return false. Pretend that we reached
119+
// control stack, it will return false. Pretend that we reached
120120
// the final EOF and stop lexing more tokens by returning false
121121
// to LexToken().
122122
if (!prepExitInclude(false))
@@ -147,7 +147,7 @@ int TGLexer::getNextChar() {
147147

148148
case 0: {
149149
// A NUL character in the stream is either the end of the current buffer or
150-
// a spurious NUL in the file. Disambiguate that here.
150+
// a spurious NUL in the file. Disambiguate that here.
151151
if (CurPtr - 1 == CurBuf.end()) {
152152
--CurPtr; // Arrange for another call to return EOF again.
153153
return EOF;
@@ -160,7 +160,7 @@ int TGLexer::getNextChar() {
160160
case '\n':
161161
case '\r':
162162
// Handle the newline character by ignoring it and incrementing the line
163-
// count. However, be careful about 'dos style' files with \n\r in them.
163+
// count. However, be careful about 'dos style' files with \n\r in them.
164164
// Only treat a \n\r or \r\n as a single line.
165165
if ((*CurPtr == '\n' || (*CurPtr == '\r')) &&
166166
*CurPtr != CurChar)
@@ -259,7 +259,7 @@ tgtok::TokKind TGLexer::LexToken(bool FileOrLineStart) {
259259
int NextChar = 0;
260260
if (isDigit(CurChar)) {
261261
// Allow identifiers to start with a number if it is followed by
262-
// an identifier. This can happen with paste operations like
262+
// an identifier. This can happen with paste operations like
263263
// foo#8i.
264264
int i = 0;
265265
do {
@@ -422,7 +422,7 @@ tgtok::TokKind TGLexer::LexIdentifier() {
422422
return Kind;
423423
}
424424

425-
/// LexInclude - We just read the "include" token. Get the string token that
425+
/// LexInclude - We just read the "include" token. Get the string token that
426426
/// comes next and enter the include.
427427
bool TGLexer::LexInclude() {
428428
// The token after the include must be a string.
@@ -461,7 +461,7 @@ void TGLexer::SkipBCPLComment() {
461461
CurPtr = (EOLPos == StringRef::npos) ? CurBuf.end() : CurBuf.data() + EOLPos;
462462
}
463463

464-
/// SkipCComment - This skips C-style /**/ comments. The only difference from C
464+
/// SkipCComment - This skips C-style /**/ comments. The only difference from C
465465
/// is that we allow nesting.
466466
bool TGLexer::SkipCComment() {
467467
++CurPtr; // skip the star.
@@ -554,8 +554,8 @@ tgtok::TokKind TGLexer::LexNumber() {
554554
return Base == 2 ? tgtok::BinaryIntVal : tgtok::IntVal;
555555
}
556556

557-
/// LexBracket - We just read '['. If this is a code block, return it,
558-
/// otherwise return the bracket. Match: '[' and '[{ ( [^}]+ | }[^]] )* }]'
557+
/// LexBracket - We just read '['. If this is a code block, return it,
558+
/// otherwise return the bracket. Match: '[' and '[{ ( [^}]+ | }[^]] )* }]'
559559
tgtok::TokKind TGLexer::LexBracket() {
560560
if (CurPtr[0] != '{')
561561
return tgtok::l_square;
@@ -687,7 +687,7 @@ tgtok::TokKind TGLexer::prepIsDirective() const {
687687
NextChar == '\n' ||
688688
// It looks like TableGen does not support '\r' as the actual
689689
// carriage return, e.g. getNextChar() treats a single '\r'
690-
// as '\n'. So we do the same here.
690+
// as '\n'. So we do the same here.
691691
NextChar == '\r')
692692
return Kind;
693693

@@ -700,7 +700,7 @@ tgtok::TokKind TGLexer::prepIsDirective() const {
700700
// #define/**/ AND #define//
701701
//
702702
// These cases will be reported as incorrect after calling
703-
// prepLexMacroName(). We could have supported C-style comments
703+
// prepLexMacroName(). We could have supported C-style comments
704704
// after #ifdef/#define, but this would complicate the code
705705
// for little benefit.
706706
if (NextChar == '/') {
@@ -733,7 +733,7 @@ void TGLexer::prepEatPreprocessorDirective(tgtok::TokKind Kind) {
733733

734734
tgtok::TokKind TGLexer::lexPreprocessor(tgtok::TokKind Kind,
735735
bool ReturnNextLiveToken) {
736-
// We must be looking at a preprocessing directive. Eat it!
736+
// We must be looking at a preprocessing directive. Eat it!
737737
prepEatPreprocessorDirective(Kind);
738738

739739
if (Kind == tgtok::Ifdef || Kind == tgtok::Ifndef) {
@@ -879,7 +879,7 @@ bool TGLexer::prepSkipRegion(bool MustNeverBeFalse) {
879879
tgtok::TokKind Kind = prepIsDirective();
880880

881881
// If we did not find a preprocessing directive or it is #define,
882-
// then just skip to the next line. We do not have to do anything
882+
// then just skip to the next line. We do not have to do anything
883883
// for #define in the line-skipping mode.
884884
if (Kind == tgtok::Error || Kind == tgtok::Define)
885885
continue;
@@ -909,7 +909,7 @@ bool TGLexer::prepSkipRegion(bool MustNeverBeFalse) {
909909
} while (CurPtr != CurBuf.end());
910910

911911
// We have reached the end of the file, but never left the lines-skipping
912-
// mode. This means there is no matching #endif.
912+
// mode. This means there is no matching #endif.
913913
prepReportPreprocessorStackError();
914914
return false;
915915
}
@@ -939,8 +939,8 @@ bool TGLexer::prepSkipLineBegin() {
939939
// Skip C-style comment.
940940
// Note that we do not care about skipping the C++-style comments.
941941
// If the line contains "//", it may not contain any processable
942-
// preprocessing directive. Just return CurPtr pointing to
943-
// the first '/' in this case. We also do not care about
942+
// preprocessing directive. Just return CurPtr pointing to
943+
// the first '/' in this case. We also do not care about
944944
// incorrect symbols after the first '/' - we are in lines-skipping
945945
// mode, so incorrect code is allowed to some extent.
946946

@@ -968,7 +968,7 @@ bool TGLexer::prepSkipLineBegin() {
968968
++CurPtr;
969969
}
970970

971-
// We have reached the end of the file. Return to the lines skipping
971+
// We have reached the end of the file. Return to the lines skipping
972972
// code, and allow it to handle the EOF as needed.
973973
return true;
974974
}
@@ -994,7 +994,7 @@ bool TGLexer::prepSkipDirectiveEnd() {
994994
SkipBCPLComment();
995995
} else if (NextChar == '*') {
996996
// When we are skipping C-style comment at the end of a preprocessing
997-
// directive, we can skip several lines. If any meaningful TD token
997+
// directive, we can skip several lines. If any meaningful TD token
998998
// follows the end of the C-style comment on the same line, it will
999999
// be considered as an invalid usage of TD token.
10001000
// For example, we want to forbid usages like this one:
@@ -1003,7 +1003,7 @@ bool TGLexer::prepSkipDirectiveEnd() {
10031003
// #define MACRO /* This macro is used
10041004
// to ... */ class Class {}
10051005
// One can argue that this should be allowed, but it does not seem
1006-
// to be worth of the complication. Moreover, this matches
1006+
// to be worth of the complication. Moreover, this matches
10071007
// the C preprocessor behavior.
10081008

10091009
// Set TokStart to the beginning of the comment to enable proper

0 commit comments

Comments
 (0)