This is an archive of the discontinued LLVM Phabricator instance.

[Tablegen] Fix AsmString parser misreading optional operands.
ClosedPublic

Authored by mwahab on Dec 4 2014, 8:11 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mwahab updated this revision to Diff 16928.Dec 4 2014, 8:11 AM
mwahab retitled this revision from to [Tablegen] Fix AsmString parser misreading optional operands. .
mwahab updated this object.
mwahab edited the test plan for this revision. (Show Details)
mwahab set the repository for this revision to rL LLVM.Dec 4 2014, 8:15 AM
mwahab added a subscriber: Unknown Object (MLST).

An instruction alias defined with InstAlias and an optional operand in the
middle of the AsmString field, "..${a} <operands>", would get the final
"}" printed in the instruction disassembly. This wouldn't happen if the optional
operand appeared as the last item in the AsmString which is how the current
backends avoided the problem.

There don't appear to be any tests for this part of Tablegen but it passes the
pre-commit tests. Manually tested the change by enabling the generic alias
printer in the ARM backend and checking the output.

Ping

Tim, you wrote the original code, can you take a look?

Thanks,
Matthew

t.p.northover accepted this revision.Dec 16 2014, 8:17 AM
t.p.northover added a reviewer: t.p.northover.

The changes look reasonable, but it'd be good to have some context on why you're doing it. Is this a prelude to enabling the Alias printing on ARM instead of using the custom code?

Cheers.

Tim.

This revision is now accepted and ready to land.Dec 16 2014, 8:17 AM

From: Tim Northover [mailto:t.p.northover@gmail.com]
Sent: 16 December 2014 16:18

The changes look reasonable, but it'd be good to have some context on why
you're doing it. Is this a prelude to enabling the Alias printing on ARM
instead of using the custom code?

Thanks for reviewing the patch.

It removes an obstacle to the ARM backend switching, which would probably be a
good thing but is rather more than I'm planning to do. The generic and custom
printers produce different outputs for some instructions and fixing that will
take some care. For now, this is just to fix a bug in the Tablegen output.

There's a second related patch for the Tablegen'd alias printer at
http://reviews.llvm.org/D6530, if you could take a look. I'm not sure whether
you worked on that part though.

Matthew

REPOSITORY

rL LLVM

http://reviews.llvm.org/D6529

EMAIL PREFERENCES

http://reviews.llvm.org/settings/panel/emailpreferences/
This revision was automatically updated to reflect the committed changes.