[PATCH] D29963: Apply different tokenization rules to linker script expressions.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 14:18:07 PST 2017


ruiu created this revision.

The linker script lexer is context-sensitive. In the regular context,
arithmetic operator characters are regular characters, but in the
expression context, they are independent tokens. This afects how the
lexer tokenizes "3*4", for example. (This kind of expression is real;
the Linux kernel uses it.)

This patch defines function `maybeSplitExpr`. This function splits the
current token into multiple expression tokens if the lexer is in the
expression context.


https://reviews.llvm.org/D29963

Files:
  lld/ELF/LinkerScript.cpp
  lld/ELF/ScriptLexer.cpp
  lld/ELF/ScriptLexer.h
  lld/test/ELF/linkerscript/operators.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29963.88436.patch
Type: text/x-patch
Size: 5153 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170214/fb8cfc66/attachment.bin>


More information about the llvm-commits mailing list