[PATCH] Fix error in tablegen when second operand of an !if is an empty list.
Matt Arsenault
arsenm2 at gmail.com
Sun Feb 16 21:45:29 PST 2014
On Feb 16, 2014, at 3:37 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> Testcase?
This other patch doesn’t work without this:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140203/204278.html
>
> On 2014 Feb 7, at 15:00, Matt Arsenault <Matthew.Arsenault at amd.com> wrote:
>
>> !if([Something], []) would error with "No type for list".
>>
>>
>> http://llvm-reviews.chandlerc.com/D2724
>>
>> Files:
>> lib/TableGen/TGParser.cpp
>>
>> Index: lib/TableGen/TGParser.cpp
>> ===================================================================
>> --- lib/TableGen/TGParser.cpp
>> +++ lib/TableGen/TGParser.cpp
>> @@ -1028,7 +1028,13 @@
>> }
>> Lex.Lex(); // eat the ','
>>
>> - Init *RHS = ParseValue(CurRec);
>> + // Get the type in case the second operand might be an empty list. We can
>> + // infer the next item's type is the same.
>> + RecTy *MHSTy = 0;
>> + if (TypedInit *MHSt = dyn_cast<TypedInit>(MHS))
>> + MHSTy = MHSt->getType();
>> +
>> + Init *RHS = ParseValue(CurRec, MHSTy);
>> if (RHS == 0) return 0;
>>
>> if (Lex.getCode() != tgtok::r_paren) {
>> <D2724.1.patch>_______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list