[PATCH] D36508: [ELF] - Linkerscript: Add `~` as separate math token.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 11 11:34:34 PDT 2017
LGTM
George Rimar via Phabricator <reviews at reviews.llvm.org> writes:
> grimar updated this revision to Diff 118556.
> grimar edited the summary of this revision.
>
> https://reviews.llvm.org/D36508
>
> Files:
> ELF/ScriptLexer.cpp
> test/ELF/linkerscript/symbol-assignexpr.s
>
>
> Index: test/ELF/linkerscript/symbol-assignexpr.s
> ===================================================================
> --- test/ELF/linkerscript/symbol-assignexpr.s
> +++ test/ELF/linkerscript/symbol-assignexpr.s
> @@ -6,7 +6,7 @@
> # RUN: symbol2 = symbol + 0x1234; \
> # RUN: symbol3 = symbol2; \
> # RUN: symbol4 = symbol + -4; \
> -# RUN: symbol5 = symbol - ~ 0xfffb; \
> +# RUN: symbol5 = symbol - ~0xfffb; \
> # RUN: symbol6 = symbol - ~(0xfff0 + 0xb); \
> # RUN: symbol7 = symbol - ~ 0xfffb + 4; \
> # RUN: symbol8 = ~ 0xffff + 4; \
> Index: ELF/ScriptLexer.cpp
> ===================================================================
> --- ELF/ScriptLexer.cpp
> +++ ELF/ScriptLexer.cpp
> @@ -164,7 +164,7 @@
> // Split a given string as an expression.
> // This function returns "3", "*" and "5" for "3*5" for example.
> static std::vector<StringRef> tokenizeExpr(StringRef S) {
> - StringRef Ops = "+-*/:!"; // List of operators
> + StringRef Ops = "+-*/:!~"; // List of operators
>
> // Quoted strings are literal strings, so we don't want to split it.
> if (S.startswith("\""))
>
>
> Index: test/ELF/linkerscript/symbol-assignexpr.s
> ===================================================================
> --- test/ELF/linkerscript/symbol-assignexpr.s
> +++ test/ELF/linkerscript/symbol-assignexpr.s
> @@ -6,7 +6,7 @@
> # RUN: symbol2 = symbol + 0x1234; \
> # RUN: symbol3 = symbol2; \
> # RUN: symbol4 = symbol + -4; \
> -# RUN: symbol5 = symbol - ~ 0xfffb; \
> +# RUN: symbol5 = symbol - ~0xfffb; \
> # RUN: symbol6 = symbol - ~(0xfff0 + 0xb); \
> # RUN: symbol7 = symbol - ~ 0xfffb + 4; \
> # RUN: symbol8 = ~ 0xffff + 4; \
> Index: ELF/ScriptLexer.cpp
> ===================================================================
> --- ELF/ScriptLexer.cpp
> +++ ELF/ScriptLexer.cpp
> @@ -164,7 +164,7 @@
> // Split a given string as an expression.
> // This function returns "3", "*" and "5" for "3*5" for example.
> static std::vector<StringRef> tokenizeExpr(StringRef S) {
> - StringRef Ops = "+-*/:!"; // List of operators
> + StringRef Ops = "+-*/:!~"; // List of operators
>
> // Quoted strings are literal strings, so we don't want to split it.
> if (S.startswith("\""))
More information about the llvm-commits
mailing list