[llvm-commits] [llvm] r121166 - /llvm/trunk/utils/TableGen/FastISelEmitter.cpp

Chris Lattner clattner at apple.com
Tue Dec 7 14:36:53 PST 2010


On Dec 7, 2010, at 12:27 PM, Jim Grosbach wrote:

>>> }
>> 
>> Hmm? What's going on here?
> 
> 
> If two tblgen records have the same pattern, they hit this. copy/paste errors or somesuch, usually. E.g.,
> 
> def Pat<(add GPR:$Rd, GPR:$Rn, GPR:$Rm)
> 		(ADD GPR:$Rd, GPR:$Rn, GPR:$Rm)>;
> def Pat<(add GPR:$Rd, GPR:$Rn, GPR:$Rm)
> 		(SUB GPR:$Rd, GPR:$Rn, GPR:$Rm)>;
> 
> These patterns have the same source pattern, and so will trigger this condition. The assert was only marginally helpful and darned ugly. The diagnostic is slightly more helpful, though still not what we really want (see FIXME), and a lot less ugly.

Ok, do you have the record for the Pat pattern?  If you use:
   throw TGError(TheDef->getLoc(), "message")
then you'll get a caret pointing to the duplicate def in the error message.

-Chris



More information about the llvm-commits mailing list