[PATCH] D65550: [AArch64] Do not emit '#' before immediates in inline asm
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 18 19:22:40 PST 2019
nickdesaulniers added a comment.
So you could maybe do:
// generator
#define DECLARE(SYM, VAL) \
__asm("DEFINITION__define__" SYM ":\t .ascii #\"%0\"" : : "i" ((u_long)(VAL)))
// makefile
assym.s: genassym.o
$(_v)sed -e '/^[[:space:]]*DEFINITION__define__/!d;{N;s/\n//;}' -e 's/^[[:space:]]*DEFINITION__define__\([^:]*\):.*ascii.*\"[#\$$]*\([-0-9\#]*\)\".*$$/#define \1 \2/' -e 'p' -e 's/#//2' -e 's/^[[:space:]]*#define \([A-Za-z0-9_]*\)[[:space:]]*[\$$#]*\([-0-9]*\).*$$/#define \1_NUM \2/' genassym.o > $@
(That's an extra `#` in the asm and in the makefile).
It's easier to mentally parse that Makefile statement if you split on `-e`.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65550/new/
https://reviews.llvm.org/D65550
More information about the llvm-commits
mailing list