File tree Expand file tree Collapse file tree 3 files changed +8
-21
lines changed Expand file tree Collapse file tree 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) {
279279 return false ;
280280}
281281
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-
294282void ScriptLexer::skip () { (void )next (); }
295283
296284void ScriptLexer::expect (StringRef expect) {
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ class ScriptLexer {
2929 void skip ();
3030 bool consume (StringRef tok);
3131 void expect (StringRef expect);
32- bool consumeLabel (StringRef tok);
3332 std::string getCurrentLocation ();
3433 MemoryBufferRef getCurrentMB ();
3534
Original file line number Diff line number Diff line change @@ -1719,20 +1719,20 @@ ScriptParser::readSymbols() {
17191719 while (!errorCount ()) {
17201720 if (consume (" }" ))
17211721 break ;
1722- if (consumeLabel (" local" )) {
1723- v = &locals;
1724- continue ;
1725- }
1726- if (consumeLabel (" global" )) {
1727- v = &globals;
1728- continue ;
1729- }
17301722
17311723 if (consume (" extern" )) {
17321724 SmallVector<SymbolVersion, 0 > ext = readVersionExtern ();
17331725 v->insert (v->end (), ext.begin (), ext.end ());
17341726 } else {
17351727 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+ }
17361736 v->push_back ({unquote (tok), false , hasWildcard (tok)});
17371737 }
17381738 expect (" ;" );
You can’t perform that action at this time.
0 commit comments