File tree 3 files changed +8
-21
lines changed
3 files changed +8
-21
lines changed Original file line number Diff line number Diff line change @@ -279,18 +279,6 @@ bool ScriptLexer::consume(StringRef tok) {
279
279
return false ;
280
280
}
281
281
282
- // Consumes Tok followed by ":". Space is allowed between Tok and ":".
283
- bool ScriptLexer::consumeLabel (StringRef tok) {
284
- if (consume ((tok + " :" ).str ()))
285
- return true ;
286
- if (tokens.size () >= pos + 2 && tokens[pos] == tok &&
287
- tokens[pos + 1 ] == " :" ) {
288
- pos += 2 ;
289
- return true ;
290
- }
291
- return false ;
292
- }
293
-
294
282
void ScriptLexer::skip () { (void )next (); }
295
283
296
284
void ScriptLexer::expect (StringRef expect) {
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ class ScriptLexer {
29
29
void skip ();
30
30
bool consume (StringRef tok);
31
31
void expect (StringRef expect);
32
- bool consumeLabel (StringRef tok);
33
32
std::string getCurrentLocation ();
34
33
MemoryBufferRef getCurrentMB ();
35
34
Original file line number Diff line number Diff line change @@ -1719,20 +1719,20 @@ ScriptParser::readSymbols() {
1719
1719
while (!errorCount ()) {
1720
1720
if (consume (" }" ))
1721
1721
break ;
1722
- if (consumeLabel (" local" )) {
1723
- v = &locals;
1724
- continue ;
1725
- }
1726
- if (consumeLabel (" global" )) {
1727
- v = &globals;
1728
- continue ;
1729
- }
1730
1722
1731
1723
if (consume (" extern" )) {
1732
1724
SmallVector<SymbolVersion, 0 > ext = readVersionExtern ();
1733
1725
v->insert (v->end (), ext.begin (), ext.end ());
1734
1726
} else {
1735
1727
StringRef tok = next ();
1728
+ if (tok == " local:" || (tok == " local" && consume (" :" ))) {
1729
+ v = &locals;
1730
+ continue ;
1731
+ }
1732
+ if (tok == " global:" || (tok == " global" && consume (" :" ))) {
1733
+ v = &globals;
1734
+ continue ;
1735
+ }
1736
1736
v->push_back ({unquote (tok), false , hasWildcard (tok)});
1737
1737
}
1738
1738
expect (" ;" );
You can’t perform that action at this time.
0 commit comments