[PATCH] TableGen: Put NoRegAltName up front in RegAltNameIndices

David Siegel david.siegel at artcom.de
Wed Jun 24 10:38:58 PDT 2015


> On 16.06.2015, at 12:17, David Siegel <david.siegel at artcom.de> wrote:
> Hi,
> AsmWriterEmitter::EmitGetRegisterName(...) assumes that the special item NoRegAltName is the first item in RegAltNameIndices (see AsmWriterEmitter.cpp:613). If it happens to be second element the namespace is empty and the generated code does not compile. I fixed this by moving the NoRegAltName item up front in CodeGenTarget::ReadRegAltNameIndices().

To reproduce add this line to any RegisterInfo.td, adjust the namespace and recompile:

let Namespace = “X86" in { def ABC : RegAltNameIndex; }

This line succeeds:

let Namespace = “X86" in { def XYZ : RegAltNameIndex; }

I verified that the patch is still good. This is my first contribution. Let me know if something is missing.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-TableGen-Fix-order-in-RegAltNameIndices.patch
Type: application/octet-stream
Size: 1756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150624/2afb7e56/attachment.obj>

More information about the llvm-commits mailing list