[llvm-commits] [patch]Fix for TableGen decoder generator

Silviu Baranga silbar01 at arm.com
Fri Mar 30 02:04:30 PDT 2012


Hi,

 

TableGen's decoder generator does not add a break in the switch statements
for decoding structure's leaf nodes, because it considers that the leaf
nodes will always exit with a return. This is however not true for some
backends (for example the ARM backend) where we have to match multiple
architectures and an 'if' statement is generated to guard the leaf node.

 

When failing the architecture check, without the break statement, the
decoder will incorrectly fall through to the next branch and match other
instructions that do  not correspond to the input bitpattern.

 

The attached patch fixes this by making TableGen always emit a break
statement for leaf nodes.

 

Please review this patch.

 

Thanks,

Silviu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120330/e19c76c8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tbgen_cf.diff
Type: application/octet-stream
Size: 572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120330/e19c76c8/attachment.obj>


More information about the llvm-commits mailing list