Bug fix in Tblgen

Malul, Elior elior.malul at intel.com
Fri Apr 5 00:39:52 PDT 2013


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.

Tests:
======
I've ran make check. Also,  I have added a test case for the crash scenario, to be ran as part of the LIT test.

I'll appreciate any reviews and comments.
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblgen.patch
Type: application/octet-stream
Size: 2272 bytes
Desc: tblgen.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130405/273cc1a6/attachment.obj>


More information about the llvm-commits mailing list