[PATCH] D30500: [ELF] - Do not treat colon(":") as separate token in script parser.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 04:33:18 PST 2017


grimar added inline comments.


================
Comment at: ELF/LinkerScript.cpp:1975-1977
+bool ScriptParser::isNextLocal() {
+  return peek() == "local:" || (peek() == "local" && peek(1) == ":");
+}
----------------
ruiu wrote:
> Handling only "local:" is not good. You have the same issue with "global:". You want to change this to `bool consumeLabel(StringRef)` and use it as `consumeLabel("local")` or `consumeLabel("global")`. It also needs comment that this is the only part that makes the grammar LL(2).
Ok. I think it I need peakLabel too, to be able handle code like:
(line 2015).
```
if (peek() == "}" || Error || isNextLocal())
 break;
```


https://reviews.llvm.org/D30500





More information about the llvm-commits mailing list