Skip to content

Commit 3e24dd4

Browse files
authored
[NFC] Rename variables to conform to LLVM coding standards (#109166)
Rename `indent` to `Indent` and `o` to `OS`. Rename `Indentation` to `Indent`. Remove unused argument from `emitPredicateMatch`. Change `Indent` argument to `emitBinaryParser` to by value.
1 parent 486f790 commit 3e24dd4

File tree

3 files changed

+184
-190
lines changed

3 files changed

+184
-190
lines changed

llvm/utils/TableGen/Common/DAGISelMatcher.cpp

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ using namespace llvm;
1717

1818
void Matcher::anchor() {}
1919

20-
void Matcher::dump() const { print(errs(), 0); }
20+
void Matcher::dump() const { print(errs()); }
2121

22-
void Matcher::print(raw_ostream &OS, unsigned indent) const {
23-
printImpl(OS, indent);
22+
void Matcher::print(raw_ostream &OS, unsigned Indent) const {
23+
printImpl(OS, Indent);
2424
if (Next)
25-
return Next->print(OS, indent);
25+
return Next->print(OS, Indent);
2626
}
2727

2828
void Matcher::printOne(raw_ostream &OS) const { printImpl(OS, 0); }
@@ -111,156 +111,156 @@ unsigned CheckPredicateMatcher::getOperandNo(unsigned i) const {
111111

112112
// printImpl methods.
113113

114-
void ScopeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
115-
OS.indent(indent) << "Scope\n";
114+
void ScopeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
115+
OS.indent(Indent) << "Scope\n";
116116
for (const Matcher *C : Children) {
117117
if (!C)
118-
OS.indent(indent + 1) << "NULL POINTER\n";
118+
OS.indent(Indent + 1) << "NULL POINTER\n";
119119
else
120-
C->print(OS, indent + 2);
120+
C->print(OS, Indent + 2);
121121
}
122122
}
123123

124-
void RecordMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
125-
OS.indent(indent) << "Record\n";
124+
void RecordMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
125+
OS.indent(Indent) << "Record\n";
126126
}
127127

128-
void RecordChildMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
129-
OS.indent(indent) << "RecordChild: " << ChildNo << '\n';
128+
void RecordChildMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
129+
OS.indent(Indent) << "RecordChild: " << ChildNo << '\n';
130130
}
131131

132-
void RecordMemRefMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
133-
OS.indent(indent) << "RecordMemRef\n";
132+
void RecordMemRefMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
133+
OS.indent(Indent) << "RecordMemRef\n";
134134
}
135135

136136
void CaptureGlueInputMatcher::printImpl(raw_ostream &OS,
137-
unsigned indent) const {
138-
OS.indent(indent) << "CaptureGlueInput\n";
137+
unsigned Indent) const {
138+
OS.indent(Indent) << "CaptureGlueInput\n";
139139
}
140140

141-
void MoveChildMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
142-
OS.indent(indent) << "MoveChild " << ChildNo << '\n';
141+
void MoveChildMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
142+
OS.indent(Indent) << "MoveChild " << ChildNo << '\n';
143143
}
144144

145145
void MoveSiblingMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
146146
OS.indent(Indent) << "MoveSibling " << SiblingNo << '\n';
147147
}
148148

149-
void MoveParentMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
150-
OS.indent(indent) << "MoveParent\n";
149+
void MoveParentMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
150+
OS.indent(Indent) << "MoveParent\n";
151151
}
152152

153-
void CheckSameMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
154-
OS.indent(indent) << "CheckSame " << MatchNumber << '\n';
153+
void CheckSameMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
154+
OS.indent(Indent) << "CheckSame " << MatchNumber << '\n';
155155
}
156156

157-
void CheckChildSameMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
158-
OS.indent(indent) << "CheckChild" << ChildNo << "Same\n";
157+
void CheckChildSameMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
158+
OS.indent(Indent) << "CheckChild" << ChildNo << "Same\n";
159159
}
160160

161161
void CheckPatternPredicateMatcher::printImpl(raw_ostream &OS,
162-
unsigned indent) const {
163-
OS.indent(indent) << "CheckPatternPredicate " << Predicate << '\n';
162+
unsigned Indent) const {
163+
OS.indent(Indent) << "CheckPatternPredicate " << Predicate << '\n';
164164
}
165165

166-
void CheckPredicateMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
167-
OS.indent(indent) << "CheckPredicate " << getPredicate().getFnName() << '\n';
166+
void CheckPredicateMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
167+
OS.indent(Indent) << "CheckPredicate " << getPredicate().getFnName() << '\n';
168168
}
169169

170-
void CheckOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
171-
OS.indent(indent) << "CheckOpcode " << Opcode.getEnumName() << '\n';
170+
void CheckOpcodeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
171+
OS.indent(Indent) << "CheckOpcode " << Opcode.getEnumName() << '\n';
172172
}
173173

174-
void SwitchOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
175-
OS.indent(indent) << "SwitchOpcode: {\n";
174+
void SwitchOpcodeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
175+
OS.indent(Indent) << "SwitchOpcode: {\n";
176176
for (const auto &C : Cases) {
177-
OS.indent(indent) << "case " << C.first->getEnumName() << ":\n";
178-
C.second->print(OS, indent + 2);
177+
OS.indent(Indent) << "case " << C.first->getEnumName() << ":\n";
178+
C.second->print(OS, Indent + 2);
179179
}
180-
OS.indent(indent) << "}\n";
180+
OS.indent(Indent) << "}\n";
181181
}
182182

183-
void CheckTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
184-
OS.indent(indent) << "CheckType " << getEnumName(Type) << ", ResNo=" << ResNo
183+
void CheckTypeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
184+
OS.indent(Indent) << "CheckType " << getEnumName(Type) << ", ResNo=" << ResNo
185185
<< '\n';
186186
}
187187

188-
void SwitchTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
189-
OS.indent(indent) << "SwitchType: {\n";
188+
void SwitchTypeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
189+
OS.indent(Indent) << "SwitchType: {\n";
190190
for (const auto &C : Cases) {
191-
OS.indent(indent) << "case " << getEnumName(C.first) << ":\n";
192-
C.second->print(OS, indent + 2);
191+
OS.indent(Indent) << "case " << getEnumName(C.first) << ":\n";
192+
C.second->print(OS, Indent + 2);
193193
}
194-
OS.indent(indent) << "}\n";
194+
OS.indent(Indent) << "}\n";
195195
}
196196

197-
void CheckChildTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
198-
OS.indent(indent) << "CheckChildType " << ChildNo << " " << getEnumName(Type)
197+
void CheckChildTypeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
198+
OS.indent(Indent) << "CheckChildType " << ChildNo << " " << getEnumName(Type)
199199
<< '\n';
200200
}
201201

202-
void CheckIntegerMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
203-
OS.indent(indent) << "CheckInteger " << Value << '\n';
202+
void CheckIntegerMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
203+
OS.indent(Indent) << "CheckInteger " << Value << '\n';
204204
}
205205

206206
void CheckChildIntegerMatcher::printImpl(raw_ostream &OS,
207-
unsigned indent) const {
208-
OS.indent(indent) << "CheckChildInteger " << ChildNo << " " << Value << '\n';
207+
unsigned Indent) const {
208+
OS.indent(Indent) << "CheckChildInteger " << ChildNo << " " << Value << '\n';
209209
}
210210

211-
void CheckCondCodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
212-
OS.indent(indent) << "CheckCondCode ISD::" << CondCodeName << '\n';
211+
void CheckCondCodeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
212+
OS.indent(Indent) << "CheckCondCode ISD::" << CondCodeName << '\n';
213213
}
214214

215215
void CheckChild2CondCodeMatcher::printImpl(raw_ostream &OS,
216-
unsigned indent) const {
217-
OS.indent(indent) << "CheckChild2CondCode ISD::" << CondCodeName << '\n';
216+
unsigned Indent) const {
217+
OS.indent(Indent) << "CheckChild2CondCode ISD::" << CondCodeName << '\n';
218218
}
219219

220-
void CheckValueTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
221-
OS.indent(indent) << "CheckValueType " << getEnumName(VT) << '\n';
220+
void CheckValueTypeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
221+
OS.indent(Indent) << "CheckValueType " << getEnumName(VT) << '\n';
222222
}
223223

224-
void CheckComplexPatMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
225-
OS.indent(indent) << "CheckComplexPat " << Pattern.getSelectFunc() << '\n';
224+
void CheckComplexPatMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
225+
OS.indent(Indent) << "CheckComplexPat " << Pattern.getSelectFunc() << '\n';
226226
}
227227

228-
void CheckAndImmMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
229-
OS.indent(indent) << "CheckAndImm " << Value << '\n';
228+
void CheckAndImmMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
229+
OS.indent(Indent) << "CheckAndImm " << Value << '\n';
230230
}
231231

232-
void CheckOrImmMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
233-
OS.indent(indent) << "CheckOrImm " << Value << '\n';
232+
void CheckOrImmMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
233+
OS.indent(Indent) << "CheckOrImm " << Value << '\n';
234234
}
235235

236236
void CheckFoldableChainNodeMatcher::printImpl(raw_ostream &OS,
237-
unsigned indent) const {
238-
OS.indent(indent) << "CheckFoldableChainNode\n";
237+
unsigned Indent) const {
238+
OS.indent(Indent) << "CheckFoldableChainNode\n";
239239
}
240240

241241
void CheckImmAllOnesVMatcher::printImpl(raw_ostream &OS,
242-
unsigned indent) const {
243-
OS.indent(indent) << "CheckAllOnesV\n";
242+
unsigned Indent) const {
243+
OS.indent(Indent) << "CheckAllOnesV\n";
244244
}
245245

246246
void CheckImmAllZerosVMatcher::printImpl(raw_ostream &OS,
247-
unsigned indent) const {
248-
OS.indent(indent) << "CheckAllZerosV\n";
247+
unsigned Indent) const {
248+
OS.indent(Indent) << "CheckAllZerosV\n";
249249
}
250250

251-
void EmitIntegerMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
252-
OS.indent(indent) << "EmitInteger " << Val << " VT=" << getEnumName(VT)
251+
void EmitIntegerMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
252+
OS.indent(Indent) << "EmitInteger " << Val << " VT=" << getEnumName(VT)
253253
<< '\n';
254254
}
255255

256256
void EmitStringIntegerMatcher::printImpl(raw_ostream &OS,
257-
unsigned indent) const {
258-
OS.indent(indent) << "EmitStringInteger " << Val << " VT=" << getEnumName(VT)
257+
unsigned Indent) const {
258+
OS.indent(Indent) << "EmitStringInteger " << Val << " VT=" << getEnumName(VT)
259259
<< '\n';
260260
}
261261

262-
void EmitRegisterMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
263-
OS.indent(indent) << "EmitRegister ";
262+
void EmitRegisterMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
263+
OS.indent(Indent) << "EmitRegister ";
264264
if (Reg)
265265
OS << Reg->getName();
266266
else
@@ -269,26 +269,26 @@ void EmitRegisterMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
269269
}
270270

271271
void EmitConvertToTargetMatcher::printImpl(raw_ostream &OS,
272-
unsigned indent) const {
273-
OS.indent(indent) << "EmitConvertToTarget " << Slot << '\n';
272+
unsigned Indent) const {
273+
OS.indent(Indent) << "EmitConvertToTarget " << Slot << '\n';
274274
}
275275

276276
void EmitMergeInputChainsMatcher::printImpl(raw_ostream &OS,
277-
unsigned indent) const {
278-
OS.indent(indent) << "EmitMergeInputChains <todo: args>\n";
277+
unsigned Indent) const {
278+
OS.indent(Indent) << "EmitMergeInputChains <todo: args>\n";
279279
}
280280

281-
void EmitCopyToRegMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
282-
OS.indent(indent) << "EmitCopyToReg <todo: args>\n";
281+
void EmitCopyToRegMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
282+
OS.indent(Indent) << "EmitCopyToReg <todo: args>\n";
283283
}
284284

285-
void EmitNodeXFormMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
286-
OS.indent(indent) << "EmitNodeXForm " << NodeXForm->getName()
285+
void EmitNodeXFormMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
286+
OS.indent(Indent) << "EmitNodeXForm " << NodeXForm->getName()
287287
<< " Slot=" << Slot << '\n';
288288
}
289289

290-
void EmitNodeMatcherCommon::printImpl(raw_ostream &OS, unsigned indent) const {
291-
OS.indent(indent);
290+
void EmitNodeMatcherCommon::printImpl(raw_ostream &OS, unsigned Indent) const {
291+
OS.indent(Indent);
292292
OS << (isa<MorphNodeToMatcher>(this) ? "MorphNodeTo: " : "EmitNode: ")
293293
<< CGI.Namespace << "::" << CGI.TheDef->getName() << ": <todo flags> ";
294294

@@ -300,10 +300,10 @@ void EmitNodeMatcherCommon::printImpl(raw_ostream &OS, unsigned indent) const {
300300
OS << ")\n";
301301
}
302302

303-
void CompleteMatchMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
304-
OS.indent(indent) << "CompleteMatch <todo args>\n";
305-
OS.indent(indent) << "Src = " << Pattern.getSrcPattern() << "\n";
306-
OS.indent(indent) << "Dst = " << Pattern.getDstPattern() << "\n";
303+
void CompleteMatchMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
304+
OS.indent(Indent) << "CompleteMatch <todo args>\n";
305+
OS.indent(Indent) << "Src = " << Pattern.getSrcPattern() << "\n";
306+
OS.indent(Indent) << "Dst = " << Pattern.getDstPattern() << "\n";
307307
}
308308

309309
bool CheckOpcodeMatcher::isEqualImpl(const Matcher *M) const {

llvm/utils/TableGen/Common/DAGISelMatcher.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class MoveParentMatcher : public Matcher {
370370
static bool classof(const Matcher *N) { return N->getKind() == MoveParent; }
371371

372372
private:
373-
void printImpl(raw_ostream &OS, unsigned indent) const override;
373+
void printImpl(raw_ostream &OS, unsigned Indent) const override;
374374
bool isEqualImpl(const Matcher *M) const override { return true; }
375375
};
376376

@@ -389,7 +389,7 @@ class CheckSameMatcher : public Matcher {
389389
static bool classof(const Matcher *N) { return N->getKind() == CheckSame; }
390390

391391
private:
392-
void printImpl(raw_ostream &OS, unsigned indent) const override;
392+
void printImpl(raw_ostream &OS, unsigned Indent) const override;
393393
bool isEqualImpl(const Matcher *M) const override {
394394
return cast<CheckSameMatcher>(M)->getMatchNumber() == getMatchNumber();
395395
}
@@ -414,7 +414,7 @@ class CheckChildSameMatcher : public Matcher {
414414
}
415415

416416
private:
417-
void printImpl(raw_ostream &OS, unsigned indent) const override;
417+
void printImpl(raw_ostream &OS, unsigned Indent) const override;
418418
bool isEqualImpl(const Matcher *M) const override {
419419
return cast<CheckChildSameMatcher>(M)->ChildNo == ChildNo &&
420420
cast<CheckChildSameMatcher>(M)->MatchNumber == MatchNumber;

0 commit comments

Comments
 (0)