[ELF] Remove consumeLabel in ScriptLexer (#99567)

This commit removes `consumeLabel` since we can just use consume
function to have the same functionalities.
This commit is contained in:
Hongyu Chen
2024-07-23 22:03:46 -07:00
committed by GitHub
parent 6461e53781
commit 2ae862b74b
3 changed files with 8 additions and 21 deletions

View File

@@ -1719,20 +1719,20 @@ ScriptParser::readSymbols() {
while (!errorCount()) {
if (consume("}"))
break;
if (consumeLabel("local")) {
v = &locals;
continue;
}
if (consumeLabel("global")) {
v = &globals;
continue;
}
if (consume("extern")) {
SmallVector<SymbolVersion, 0> ext = readVersionExtern();
v->insert(v->end(), ext.begin(), ext.end());
} else {
StringRef tok = next();
if (tok == "local:" || (tok == "local" && consume(":"))) {
v = &locals;
continue;
}
if (tok == "global:" || (tok == "global" && consume(":"))) {
v = &globals;
continue;
}
v->push_back({unquote(tok), false, hasWildcard(tok)});
}
expect(";");