[llvm-commits] CVS: llvm/utils/TableGen/FileParser.cpp.cvs FileParser.y FileParser.y.cvs
Chris Lattner
lattner at cs.uiuc.edu
Fri Sep 1 14:59:17 PDT 2006
Changes in directory llvm/utils/TableGen:
FileParser.cpp.cvs updated: 1.4 -> 1.5
FileParser.y updated: 1.43 -> 1.44
FileParser.y.cvs updated: 1.4 -> 1.5
---
Log message:
fix an assertion with multidefs. Def inside of multiclasses don't need to
be complete.
---
Diffs of the changes: (+37 -25)
FileParser.cpp.cvs | 50 +++++++++++++++++++++++++++-----------------------
FileParser.y | 6 +++++-
FileParser.y.cvs | 6 +++++-
3 files changed, 37 insertions(+), 25 deletions(-)
Index: llvm/utils/TableGen/FileParser.cpp.cvs
diff -u llvm/utils/TableGen/FileParser.cpp.cvs:1.4 llvm/utils/TableGen/FileParser.cpp.cvs:1.5
--- llvm/utils/TableGen/FileParser.cpp.cvs:1.4 Fri Sep 1 16:14:42 2006
+++ llvm/utils/TableGen/FileParser.cpp.cvs Fri Sep 1 16:59:03 2006
@@ -350,10 +350,10 @@
458, 471, 487, 489, 489, 493, 495, 499, 502, 506,
523, 525, 531, 531, 532, 532, 534, 536, 540, 545,
550, 553, 557, 560, 565, 566, 566, 568, 568, 570,
- 577, 595, 620, 634, 639, 641, 643, 647, 656, 670,
- 673, 677, 688, 690, 692, 697, 697, 759, 759, 760,
- 760, 762, 767, 767, 770, 770, 773, 776, 780, 780,
- 782
+ 577, 595, 620, 634, 639, 641, 643, 647, 657, 671,
+ 674, 678, 689, 691, 693, 698, 698, 763, 763, 764,
+ 764, 766, 771, 771, 774, 774, 777, 780, 784, 784,
+ 786
};
#endif
@@ -1679,7 +1679,8 @@
case 78:
#line 647 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
- yyvsp[0].Rec->resolveReferences();
+ if (CurMultiClass == 0) // Def's in multiclasses aren't really defs.
+ yyvsp[0].Rec->resolveReferences();
// If ObjectBody has template arguments, it's an error.
assert(yyvsp[0].Rec->getTemplateArgs().empty() && "How'd this get template args?");
@@ -1687,7 +1688,7 @@
;
break;}
case 79:
-#line 656 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 657 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
yyval.Rec = yyvsp[0].Rec;
// Copy the template arguments for the multiclass into the def.
@@ -1701,20 +1702,20 @@
;
break;}
case 80:
-#line 670 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 671 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
yyval.RecList = new std::vector<Record*>();
yyval.RecList->push_back(yyvsp[0].Rec);
;
break;}
case 81:
-#line 673 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 674 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
yyval.RecList->push_back(yyvsp[0].Rec);
;
break;}
case 82:
-#line 677 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 678 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
MultiClass *&MCE = MultiClasses[*yyvsp[0].StrVal];
if (MCE) {
@@ -1726,29 +1727,29 @@
;
break;}
case 83:
-#line 688 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 689 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
ParsingTemplateArgs = true;
;
break;}
case 84:
-#line 690 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 691 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
ParsingTemplateArgs = false;
;
break;}
case 85:
-#line 692 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 693 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
CurMultiClass = 0;
;
break;}
case 86:
-#line 697 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 698 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ CurDefmPrefix = yyvsp[0].StrVal; ;
break;}
case 87:
-#line 697 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 698 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
// To instantiate a multiclass, we need to first get the multiclass, then
// instantiate each def contained in the multiclass with the SubClassRef
@@ -1804,6 +1805,9 @@
exit(1);
}
Records.addDef(CurRec);
+
+ CurRec->resolveReferences();
+
CurRec = 0;
}
@@ -1812,42 +1816,42 @@
;
break;}
case 88:
-#line 759 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 763 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{;
break;}
case 89:
-#line 759 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 763 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{;
break;}
case 92:
-#line 762 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 766 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
LetStack.back().push_back(LetRecord(*yyvsp[-3].StrVal, yyvsp[-2].BitList, yyvsp[0].Initializer));
delete yyvsp[-3].StrVal; delete yyvsp[-2].BitList;
;
break;}
case 95:
-#line 770 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 774 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ LetStack.push_back(std::vector<LetRecord>()); ;
break;}
case 97:
-#line 773 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 777 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
LetStack.pop_back();
;
break;}
case 98:
-#line 776 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 780 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{
LetStack.pop_back();
;
break;}
case 99:
-#line 780 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 784 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{;
break;}
case 100:
-#line 780 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 784 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{;
break;}
}
@@ -2072,7 +2076,7 @@
}
return 1;
}
-#line 784 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
+#line 788 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
int yyerror(const char *ErrorMsg) {
Index: llvm/utils/TableGen/FileParser.y
diff -u llvm/utils/TableGen/FileParser.y:1.43 llvm/utils/TableGen/FileParser.y:1.44
--- llvm/utils/TableGen/FileParser.y:1.43 Fri Sep 1 16:13:49 2006
+++ llvm/utils/TableGen/FileParser.y Fri Sep 1 16:59:03 2006
@@ -645,7 +645,8 @@
};
DefInst : DEF DefName ObjectBody {
- $3->resolveReferences();
+ if (CurMultiClass == 0) // Def's in multiclasses aren't really defs.
+ $3->resolveReferences();
// If ObjectBody has template arguments, it's an error.
assert($3->getTemplateArgs().empty() && "How'd this get template args?");
@@ -749,6 +750,9 @@
exit(1);
}
Records.addDef(CurRec);
+
+ CurRec->resolveReferences();
+
CurRec = 0;
}
Index: llvm/utils/TableGen/FileParser.y.cvs
diff -u llvm/utils/TableGen/FileParser.y.cvs:1.4 llvm/utils/TableGen/FileParser.y.cvs:1.5
--- llvm/utils/TableGen/FileParser.y.cvs:1.4 Fri Sep 1 16:14:42 2006
+++ llvm/utils/TableGen/FileParser.y.cvs Fri Sep 1 16:59:03 2006
@@ -645,7 +645,8 @@
};
DefInst : DEF DefName ObjectBody {
- $3->resolveReferences();
+ if (CurMultiClass == 0) // Def's in multiclasses aren't really defs.
+ $3->resolveReferences();
// If ObjectBody has template arguments, it's an error.
assert($3->getTemplateArgs().empty() && "How'd this get template args?");
@@ -749,6 +750,9 @@
exit(1);
}
Records.addDef(CurRec);
+
+ CurRec->resolveReferences();
+
CurRec = 0;
}
More information about the llvm-commits
mailing list