[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 09:29:16 PST 2017


grimar 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())
----------------
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"


https://reviews.llvm.org/D30500





More information about the llvm-commits mailing list