[llvm-commits] [llvm] r125595 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp test/MC/AsmParser/exprs.s test/MC/AsmParser/paren.s

Jim Grosbach grosbach at apple.com
Wed Feb 16 09:47:22 PST 2011


On Feb 15, 2011, at 6:25 PM, Joerg Sonnenberger wrote:

> On Tue, Feb 15, 2011 at 06:02:10PM -0800, Jim Grosbach wrote:
>> Shouldn't something like this, at minimum, be predicated on a target
>> enabling it? I doubt this is something all assembly variants want.
> 
> ParseBracketExpr can be made virtual if necessary, but the current
> status quo breaks completely legal code on i386.
> 
>> For example, on x86 does Intel vs ATT syntax change whether this is
>> supported? What about other targets? Do they want this enabled at all?
>> Square brackets often have special meaning (memory references being
>> the most common) and this could very easily complicate that.
> 
> AT&T syntax doesn't care about [], I think. Intel syntax is messy as best,
> but if it could only need a virtual override.

What about other targets? ARM, MIPS, etc.. shouldn't accept bracket-as-parens expressions unless that's part of their documented syntax.

I don't know for sure how this fits into the overall asmparser scheme of things (Daniel would be the right person to answer that). I'm just noting that we want to make sure to keep things like this isolated to those targets that want the behavior.

For example, the following is not legal ARM assembly and should give a syntax error on the '[' token.
add r0, r1, #[_foo - _bar]

With these changes, that's not happening anymore.

-Jim



More information about the llvm-commits mailing list