[PATCH] D69411: [MC] Parse .if conditions with symbols in consecutive MCDataFragements
Jian Cai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 12 11:14:25 PST 2019
jcai19 added a comment.
In D69411#1742030 <https://reviews.llvm.org/D69411#1742030>, @peter.smith wrote:
>
> I note that it is possible to write a contrived example that this patch can't handle (needs --triple=armv8a-linux-gnu as crypto and crc are V8 extensions) although I'm not suggesting implementing support for it.
>
> .text
>
> nop
> 9997:
> .arch_extension crypto
> nop
> .arch_extension crc
> nop
> .if . - 9997b == 0
> // CHECK-NOT: error: expected absolute expression
> orr r1, r1, #1
> .else
> orr r1, r1, #2
> .endif .text
>
> nop
> 9997:
> .arch_extension crypto
> nop
> .arch_extension crc
> nop
> .if . - 9997b == 0
> // CHECK-NOT: error: expected absolute expression
> orr r1, r1, #1
> .else
> orr r1, r1, #2
> .endif
>
>
> if.s:11:5: error: expected absolute expression
> .if . - 9997b == 0
If we need to support cases like this, we can probably add a while loop and check if the fragments between two symbols are all MCDataFragments and sum their sizes up.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69411/new/
https://reviews.llvm.org/D69411
More information about the llvm-commits
mailing list