Bug fix in Tblgen

Malul, Elior elior.malul at intel.com
Sun Apr 7 03:53:57 PDT 2013


-----Original Message-----
From: Jakob Stoklund Olesen [mailto:stoklund at 2pi.dk] 
Sent: Friday, April 05, 2013 23:28
To: Malul, Elior
Cc: llvm-commits at cs.uiuc.edu; Sean Silva
Subject: Re: Bug fix in Tblgen


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

Hi Jacob, thx for the quick response (and on a Sunday no less), I appreciate it.
I think what you say make sense, since after all what I did is a solution to the problem, not to the problem itself.
The downside is that we will need to make another 'resolve mechanism' (since the current resolve mechanism only resolves fields).
Are you OK with that?
Thx, Elior
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.





More information about the llvm-commits mailing list