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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 09:33:55 PST 2017


ruiu added inline comments.


================
Comment at: ELF/LinkerScript.cpp:1943-1944
   // no label, we assume global symbols.
-  if (peek() != "local") {
-    if (consume("global"))
-      expect(":");
+  if (!peekLabel("local:")) {
+    consumeLabel("global:");
     for (SymbolVersion V : readSymbols())
----------------
grimar wrote:
> ruiu wrote:
> > I think you can do that without defining `peekLabel`. You should remove the first two lines from readLocals().
> This place is not a problem to avoid use of peekLabel. But 
> ScriptParser::readSymbols() need it anyways I believe:
> ```
>     if (peek() == "}" || Error || peekLabel("local:"))
>       break;
> ```
> 
> We have to know when to get out from readSymbols, one of conditions is when we meet "local"
Do you mean it is impossible? If not, please try to edit other functions.


https://reviews.llvm.org/D30500





More information about the llvm-commits mailing list