Bug fix in Tblgen

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Apr 5 13:27:32 PDT 2013


On Apr 5, 2013, at 12:39 AM, "Malul, Elior" <elior.malul at intel.com> wrote:

> Description:
> ==========
> Attached is a bug fix for tblgen crash (assert is fired).
> 
> Crash scenario:
> ============
> 
> The crash happens in cases in which the loop iterator has the same name as one of the fields of the record:
> 
> class Node<string S, int I>{
>  string s = S;
>  int i = I;
> }
> 
> foreach i = [1,2,3] in {
>  def n#i : Node<"n", i>;
> }
> 
> Solution:
> =======
> When adding the iterator variable is added to the record, I've added a check if a field with such name exists.
> If so, we temporarily add a prefix to it.
> After resolving is done, the name of the renamed field is reverted to its original name.

Hi Elior,

The handling of parameter binding in for loops is pretty weird. It doesn't really make sense to me to add the induction variable as a member of whatever class is being instantiated.

Could you fix this properly instead of working around the problem?

Thanks,

/jakob




More information about the llvm-commits mailing list