Skip to content

Commit 9afcdaa

Browse files
committed
[MCParser] De-capitalize ELFAsmParser functions. NFC
To match the convention and DarwinAsmParser.
1 parent deb22fa commit 9afcdaa

File tree

1 file changed

+79
-79
lines changed

1 file changed

+79
-79
lines changed

llvm/lib/MC/MCParser/ELFAsmParser.cpp

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ELFAsmParser : public MCAsmParserExtension {
4141
getParser().addDirectiveHandler(Directive, Handler);
4242
}
4343

44-
bool ParseSectionSwitch(StringRef Section, unsigned Type, unsigned Flags,
44+
bool parseSectionSwitch(StringRef Section, unsigned Type, unsigned Flags,
4545
SectionKind Kind);
4646

4747
public:
@@ -51,108 +51,108 @@ class ELFAsmParser : public MCAsmParserExtension {
5151
// Call the base implementation.
5252
this->MCAsmParserExtension::Initialize(Parser);
5353

54-
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveData>(".data");
55-
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveText>(".text");
56-
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveBSS>(".bss");
57-
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveRoData>(".rodata");
58-
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveTData>(".tdata");
59-
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveTBSS>(".tbss");
54+
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveData>(".data");
55+
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveText>(".text");
56+
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveBSS>(".bss");
57+
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveRoData>(".rodata");
58+
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveTData>(".tdata");
59+
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveTBSS>(".tbss");
6060
addDirectiveHandler<
61-
&ELFAsmParser::ParseSectionDirectiveDataRel>(".data.rel");
61+
&ELFAsmParser::parseSectionDirectiveDataRel>(".data.rel");
6262
addDirectiveHandler<
63-
&ELFAsmParser::ParseSectionDirectiveDataRelRo>(".data.rel.ro");
63+
&ELFAsmParser::parseSectionDirectiveDataRelRo>(".data.rel.ro");
6464
addDirectiveHandler<
65-
&ELFAsmParser::ParseSectionDirectiveEhFrame>(".eh_frame");
66-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSection>(".section");
65+
&ELFAsmParser::parseSectionDirectiveEhFrame>(".eh_frame");
66+
addDirectiveHandler<&ELFAsmParser::parseDirectiveSection>(".section");
6767
addDirectiveHandler<
68-
&ELFAsmParser::ParseDirectivePushSection>(".pushsection");
69-
addDirectiveHandler<&ELFAsmParser::ParseDirectivePopSection>(".popsection");
70-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSize>(".size");
71-
addDirectiveHandler<&ELFAsmParser::ParseDirectivePrevious>(".previous");
72-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveType>(".type");
73-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveIdent>(".ident");
74-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymver>(".symver");
75-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveVersion>(".version");
76-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveWeakref>(".weakref");
77-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymbolAttribute>(".weak");
78-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymbolAttribute>(".local");
68+
&ELFAsmParser::parseDirectivePushSection>(".pushsection");
69+
addDirectiveHandler<&ELFAsmParser::parseDirectivePopSection>(".popsection");
70+
addDirectiveHandler<&ELFAsmParser::parseDirectiveSize>(".size");
71+
addDirectiveHandler<&ELFAsmParser::parseDirectivePrevious>(".previous");
72+
addDirectiveHandler<&ELFAsmParser::parseDirectiveType>(".type");
73+
addDirectiveHandler<&ELFAsmParser::parseDirectiveIdent>(".ident");
74+
addDirectiveHandler<&ELFAsmParser::parseDirectiveSymver>(".symver");
75+
addDirectiveHandler<&ELFAsmParser::parseDirectiveVersion>(".version");
76+
addDirectiveHandler<&ELFAsmParser::parseDirectiveWeakref>(".weakref");
77+
addDirectiveHandler<&ELFAsmParser::parseDirectiveSymbolAttribute>(".weak");
78+
addDirectiveHandler<&ELFAsmParser::parseDirectiveSymbolAttribute>(".local");
7979
addDirectiveHandler<
80-
&ELFAsmParser::ParseDirectiveSymbolAttribute>(".protected");
80+
&ELFAsmParser::parseDirectiveSymbolAttribute>(".protected");
8181
addDirectiveHandler<
82-
&ELFAsmParser::ParseDirectiveSymbolAttribute>(".internal");
82+
&ELFAsmParser::parseDirectiveSymbolAttribute>(".internal");
8383
addDirectiveHandler<
84-
&ELFAsmParser::ParseDirectiveSymbolAttribute>(".hidden");
85-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSubsection>(".subsection");
86-
addDirectiveHandler<&ELFAsmParser::ParseDirectiveCGProfile>(".cg_profile");
84+
&ELFAsmParser::parseDirectiveSymbolAttribute>(".hidden");
85+
addDirectiveHandler<&ELFAsmParser::parseDirectiveSubsection>(".subsection");
86+
addDirectiveHandler<&ELFAsmParser::parseDirectiveCGProfile>(".cg_profile");
8787
}
8888

8989
// FIXME: Part of this logic is duplicated in the MCELFStreamer. What is
9090
// the best way for us to get access to it?
91-
bool ParseSectionDirectiveData(StringRef, SMLoc) {
92-
return ParseSectionSwitch(".data", ELF::SHT_PROGBITS,
91+
bool parseSectionDirectiveData(StringRef, SMLoc) {
92+
return parseSectionSwitch(".data", ELF::SHT_PROGBITS,
9393
ELF::SHF_WRITE | ELF::SHF_ALLOC,
9494
SectionKind::getData());
9595
}
96-
bool ParseSectionDirectiveText(StringRef, SMLoc) {
97-
return ParseSectionSwitch(".text", ELF::SHT_PROGBITS,
96+
bool parseSectionDirectiveText(StringRef, SMLoc) {
97+
return parseSectionSwitch(".text", ELF::SHT_PROGBITS,
9898
ELF::SHF_EXECINSTR |
9999
ELF::SHF_ALLOC, SectionKind::getText());
100100
}
101-
bool ParseSectionDirectiveBSS(StringRef, SMLoc) {
102-
return ParseSectionSwitch(".bss", ELF::SHT_NOBITS,
101+
bool parseSectionDirectiveBSS(StringRef, SMLoc) {
102+
return parseSectionSwitch(".bss", ELF::SHT_NOBITS,
103103
ELF::SHF_WRITE |
104104
ELF::SHF_ALLOC, SectionKind::getBSS());
105105
}
106-
bool ParseSectionDirectiveRoData(StringRef, SMLoc) {
107-
return ParseSectionSwitch(".rodata", ELF::SHT_PROGBITS,
106+
bool parseSectionDirectiveRoData(StringRef, SMLoc) {
107+
return parseSectionSwitch(".rodata", ELF::SHT_PROGBITS,
108108
ELF::SHF_ALLOC,
109109
SectionKind::getReadOnly());
110110
}
111-
bool ParseSectionDirectiveTData(StringRef, SMLoc) {
112-
return ParseSectionSwitch(".tdata", ELF::SHT_PROGBITS,
111+
bool parseSectionDirectiveTData(StringRef, SMLoc) {
112+
return parseSectionSwitch(".tdata", ELF::SHT_PROGBITS,
113113
ELF::SHF_ALLOC |
114114
ELF::SHF_TLS | ELF::SHF_WRITE,
115115
SectionKind::getThreadData());
116116
}
117-
bool ParseSectionDirectiveTBSS(StringRef, SMLoc) {
118-
return ParseSectionSwitch(".tbss", ELF::SHT_NOBITS,
117+
bool parseSectionDirectiveTBSS(StringRef, SMLoc) {
118+
return parseSectionSwitch(".tbss", ELF::SHT_NOBITS,
119119
ELF::SHF_ALLOC |
120120
ELF::SHF_TLS | ELF::SHF_WRITE,
121121
SectionKind::getThreadBSS());
122122
}
123-
bool ParseSectionDirectiveDataRel(StringRef, SMLoc) {
124-
return ParseSectionSwitch(".data.rel", ELF::SHT_PROGBITS,
123+
bool parseSectionDirectiveDataRel(StringRef, SMLoc) {
124+
return parseSectionSwitch(".data.rel", ELF::SHT_PROGBITS,
125125
ELF::SHF_ALLOC | ELF::SHF_WRITE,
126126
SectionKind::getData());
127127
}
128-
bool ParseSectionDirectiveDataRelRo(StringRef, SMLoc) {
129-
return ParseSectionSwitch(".data.rel.ro", ELF::SHT_PROGBITS,
128+
bool parseSectionDirectiveDataRelRo(StringRef, SMLoc) {
129+
return parseSectionSwitch(".data.rel.ro", ELF::SHT_PROGBITS,
130130
ELF::SHF_ALLOC |
131131
ELF::SHF_WRITE,
132132
SectionKind::getReadOnlyWithRel());
133133
}
134-
bool ParseSectionDirectiveEhFrame(StringRef, SMLoc) {
135-
return ParseSectionSwitch(".eh_frame", ELF::SHT_PROGBITS,
134+
bool parseSectionDirectiveEhFrame(StringRef, SMLoc) {
135+
return parseSectionSwitch(".eh_frame", ELF::SHT_PROGBITS,
136136
ELF::SHF_ALLOC | ELF::SHF_WRITE,
137137
SectionKind::getData());
138138
}
139-
bool ParseDirectivePushSection(StringRef, SMLoc);
140-
bool ParseDirectivePopSection(StringRef, SMLoc);
141-
bool ParseDirectiveSection(StringRef, SMLoc);
142-
bool ParseDirectiveSize(StringRef, SMLoc);
143-
bool ParseDirectivePrevious(StringRef, SMLoc);
144-
bool ParseDirectiveType(StringRef, SMLoc);
145-
bool ParseDirectiveIdent(StringRef, SMLoc);
146-
bool ParseDirectiveSymver(StringRef, SMLoc);
147-
bool ParseDirectiveVersion(StringRef, SMLoc);
148-
bool ParseDirectiveWeakref(StringRef, SMLoc);
149-
bool ParseDirectiveSymbolAttribute(StringRef, SMLoc);
150-
bool ParseDirectiveSubsection(StringRef, SMLoc);
151-
bool ParseDirectiveCGProfile(StringRef, SMLoc);
139+
bool parseDirectivePushSection(StringRef, SMLoc);
140+
bool parseDirectivePopSection(StringRef, SMLoc);
141+
bool parseDirectiveSection(StringRef, SMLoc);
142+
bool parseDirectiveSize(StringRef, SMLoc);
143+
bool parseDirectivePrevious(StringRef, SMLoc);
144+
bool parseDirectiveType(StringRef, SMLoc);
145+
bool parseDirectiveIdent(StringRef, SMLoc);
146+
bool parseDirectiveSymver(StringRef, SMLoc);
147+
bool parseDirectiveVersion(StringRef, SMLoc);
148+
bool parseDirectiveWeakref(StringRef, SMLoc);
149+
bool parseDirectiveSymbolAttribute(StringRef, SMLoc);
150+
bool parseDirectiveSubsection(StringRef, SMLoc);
151+
bool parseDirectiveCGProfile(StringRef, SMLoc);
152152

153153
private:
154-
bool ParseSectionName(StringRef &SectionName);
155-
bool ParseSectionArguments(bool IsPush, SMLoc loc);
154+
bool parseSectionName(StringRef &SectionName);
155+
bool parseSectionArguments(bool IsPush, SMLoc loc);
156156
unsigned parseSunStyleSectionFlags();
157157
bool maybeParseSectionType(StringRef &TypeName);
158158
bool parseMergeSize(int64_t &Size);
@@ -165,7 +165,7 @@ class ELFAsmParser : public MCAsmParserExtension {
165165

166166
/// ParseDirectiveSymbolAttribute
167167
/// ::= { ".local", ".weak", ... } [ identifier ( , identifier )* ]
168-
bool ELFAsmParser::ParseDirectiveSymbolAttribute(StringRef Directive, SMLoc) {
168+
bool ELFAsmParser::parseDirectiveSymbolAttribute(StringRef Directive, SMLoc) {
169169
MCSymbolAttr Attr = StringSwitch<MCSymbolAttr>(Directive)
170170
.Case(".weak", MCSA_Weak)
171171
.Case(".local", MCSA_Local)
@@ -204,7 +204,7 @@ bool ELFAsmParser::ParseDirectiveSymbolAttribute(StringRef Directive, SMLoc) {
204204
return false;
205205
}
206206

207-
bool ELFAsmParser::ParseSectionSwitch(StringRef Section, unsigned Type,
207+
bool ELFAsmParser::parseSectionSwitch(StringRef Section, unsigned Type,
208208
unsigned Flags, SectionKind Kind) {
209209
const MCExpr *Subsection = nullptr;
210210
if (getLexer().isNot(AsmToken::EndOfStatement)) {
@@ -219,7 +219,7 @@ bool ELFAsmParser::ParseSectionSwitch(StringRef Section, unsigned Type,
219219
return false;
220220
}
221221

222-
bool ELFAsmParser::ParseDirectiveSize(StringRef, SMLoc) {
222+
bool ELFAsmParser::parseDirectiveSize(StringRef, SMLoc) {
223223
StringRef Name;
224224
if (getParser().parseIdentifier(Name))
225225
return TokError("expected identifier");
@@ -241,7 +241,7 @@ bool ELFAsmParser::ParseDirectiveSize(StringRef, SMLoc) {
241241
return false;
242242
}
243243

244-
bool ELFAsmParser::ParseSectionName(StringRef &SectionName) {
244+
bool ELFAsmParser::parseSectionName(StringRef &SectionName) {
245245
// A section name can contain -, so we cannot just use
246246
// parseIdentifier.
247247
SMLoc FirstLoc = getLexer().getLoc();
@@ -392,25 +392,25 @@ unsigned ELFAsmParser::parseSunStyleSectionFlags() {
392392
}
393393

394394

395-
bool ELFAsmParser::ParseDirectivePushSection(StringRef s, SMLoc loc) {
395+
bool ELFAsmParser::parseDirectivePushSection(StringRef s, SMLoc loc) {
396396
getStreamer().pushSection();
397397

398-
if (ParseSectionArguments(/*IsPush=*/true, loc)) {
398+
if (parseSectionArguments(/*IsPush=*/true, loc)) {
399399
getStreamer().popSection();
400400
return true;
401401
}
402402

403403
return false;
404404
}
405405

406-
bool ELFAsmParser::ParseDirectivePopSection(StringRef, SMLoc) {
406+
bool ELFAsmParser::parseDirectivePopSection(StringRef, SMLoc) {
407407
if (!getStreamer().popSection())
408408
return TokError(".popsection without corresponding .pushsection");
409409
return false;
410410
}
411411

412-
bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc loc) {
413-
return ParseSectionArguments(/*IsPush=*/false, loc);
412+
bool ELFAsmParser::parseDirectiveSection(StringRef, SMLoc loc) {
413+
return parseSectionArguments(/*IsPush=*/false, loc);
414414
}
415415

416416
bool ELFAsmParser::maybeParseSectionType(StringRef &TypeName) {
@@ -536,10 +536,10 @@ static bool allowSectionTypeMismatch(const Triple &TT, StringRef SectionName,
536536
return false;
537537
}
538538

539-
bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
539+
bool ELFAsmParser::parseSectionArguments(bool IsPush, SMLoc loc) {
540540
StringRef SectionName;
541541

542-
if (ParseSectionName(SectionName))
542+
if (parseSectionName(SectionName))
543543
return TokError("expected identifier");
544544

545545
StringRef TypeName;
@@ -724,7 +724,7 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
724724
return false;
725725
}
726726

727-
bool ELFAsmParser::ParseDirectivePrevious(StringRef DirName, SMLoc) {
727+
bool ELFAsmParser::parseDirectivePrevious(StringRef DirName, SMLoc) {
728728
MCSectionSubPair PreviousSection = getStreamer().getPreviousSection();
729729
if (PreviousSection.first == nullptr)
730730
return TokError(".previous without corresponding .section");
@@ -752,7 +752,7 @@ static MCSymbolAttr MCAttrForString(StringRef Type) {
752752
/// ::= .type identifier , @attribute
753753
/// ::= .type identifier , %attribute
754754
/// ::= .type identifier , "attribute"
755-
bool ELFAsmParser::ParseDirectiveType(StringRef, SMLoc) {
755+
bool ELFAsmParser::parseDirectiveType(StringRef, SMLoc) {
756756
StringRef Name;
757757
if (getParser().parseIdentifier(Name))
758758
return TokError("expected identifier");
@@ -805,7 +805,7 @@ bool ELFAsmParser::ParseDirectiveType(StringRef, SMLoc) {
805805

806806
/// ParseDirectiveIdent
807807
/// ::= .ident string
808-
bool ELFAsmParser::ParseDirectiveIdent(StringRef, SMLoc) {
808+
bool ELFAsmParser::parseDirectiveIdent(StringRef, SMLoc) {
809809
if (getLexer().isNot(AsmToken::String))
810810
return TokError("expected string");
811811

@@ -823,7 +823,7 @@ bool ELFAsmParser::ParseDirectiveIdent(StringRef, SMLoc) {
823823

824824
/// ParseDirectiveSymver
825825
/// ::= .symver foo, bar2@zed
826-
bool ELFAsmParser::ParseDirectiveSymver(StringRef, SMLoc) {
826+
bool ELFAsmParser::parseDirectiveSymver(StringRef, SMLoc) {
827827
StringRef OriginalName, Name, Action;
828828
if (getParser().parseIdentifier(OriginalName))
829829
return TokError("expected identifier");
@@ -860,7 +860,7 @@ bool ELFAsmParser::ParseDirectiveSymver(StringRef, SMLoc) {
860860

861861
/// ParseDirectiveVersion
862862
/// ::= .version string
863-
bool ELFAsmParser::ParseDirectiveVersion(StringRef, SMLoc) {
863+
bool ELFAsmParser::parseDirectiveVersion(StringRef, SMLoc) {
864864
if (getLexer().isNot(AsmToken::String))
865865
return TokError("expected string");
866866

@@ -884,7 +884,7 @@ bool ELFAsmParser::ParseDirectiveVersion(StringRef, SMLoc) {
884884

885885
/// ParseDirectiveWeakref
886886
/// ::= .weakref foo, bar
887-
bool ELFAsmParser::ParseDirectiveWeakref(StringRef, SMLoc) {
887+
bool ELFAsmParser::parseDirectiveWeakref(StringRef, SMLoc) {
888888
// FIXME: Share code with the other alias building directives.
889889

890890
StringRef AliasName;
@@ -908,7 +908,7 @@ bool ELFAsmParser::ParseDirectiveWeakref(StringRef, SMLoc) {
908908
return false;
909909
}
910910

911-
bool ELFAsmParser::ParseDirectiveSubsection(StringRef, SMLoc) {
911+
bool ELFAsmParser::parseDirectiveSubsection(StringRef, SMLoc) {
912912
const MCExpr *Subsection = MCConstantExpr::create(0, getContext());
913913
if (getLexer().isNot(AsmToken::EndOfStatement)) {
914914
if (getParser().parseExpression(Subsection))
@@ -924,7 +924,7 @@ bool ELFAsmParser::ParseDirectiveSubsection(StringRef, SMLoc) {
924924
Subsection);
925925
}
926926

927-
bool ELFAsmParser::ParseDirectiveCGProfile(StringRef S, SMLoc Loc) {
927+
bool ELFAsmParser::parseDirectiveCGProfile(StringRef S, SMLoc Loc) {
928928
return MCAsmParserExtension::ParseDirectiveCGProfile(S, Loc);
929929
}
930930

0 commit comments

Comments
 (0)