regenerate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30888 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-10-11 18:13:09 +00:00
parent 1ceb6c830f
commit bcc3f0a61d
2 changed files with 116 additions and 100 deletions

View File

@ -1,5 +1,5 @@
/* A Bison parser, made from /Users/sabre/cvs/llvm/utils/TableGen/FileParser.y /* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y
by GNU Bison version 1.28 */ by GNU Bison version 1.28 */
#define YYBISON 1 /* Identify Bison output. */ #define YYBISON 1 /* Identify Bison output. */
@ -35,7 +35,7 @@
#define STRVAL 278 #define STRVAL 278
#define CODEFRAGMENT 279 #define CODEFRAGMENT 279
#line 14 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 14 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
#include "Record.h" #include "Record.h"
#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringExtras.h"
@ -230,7 +230,7 @@ static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
using namespace llvm; using namespace llvm;
#line 209 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 209 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
typedef union { typedef union {
std::string* StrVal; std::string* StrVal;
int IntVal; int IntVal;
@ -352,9 +352,9 @@ static const short yyrline[] = { 0,
524, 526, 532, 532, 533, 533, 535, 537, 541, 546, 524, 526, 532, 532, 533, 533, 535, 537, 541, 546,
551, 554, 558, 561, 566, 567, 567, 569, 569, 571, 551, 554, 558, 561, 566, 567, 567, 569, 569, 571,
578, 596, 621, 635, 640, 642, 644, 648, 658, 672, 578, 596, 621, 635, 640, 642, 644, 648, 658, 672,
675, 679, 690, 692, 694, 699, 699, 765, 765, 766, 675, 679, 690, 692, 694, 699, 699, 773, 773, 774,
766, 768, 773, 773, 776, 776, 779, 782, 786, 786, 774, 776, 781, 781, 784, 784, 787, 790, 794, 794,
788 796
}; };
#endif #endif
@ -1059,7 +1059,7 @@ yyreduce:
switch (yyn) { switch (yyn) {
case 1: case 1:
#line 245 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 245 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
if (CurDefmPrefix) { if (CurDefmPrefix) {
// If CurDefmPrefix is set, we're parsing a defm, which means that this is // If CurDefmPrefix is set, we're parsing a defm, which means that this is
@ -1081,71 +1081,71 @@ case 1:
; ;
break;} break;}
case 2: case 2:
#line 267 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 267 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ // string type { // string type
yyval.Ty = new StringRecTy(); yyval.Ty = new StringRecTy();
; ;
break;} break;}
case 3: case 3:
#line 269 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 269 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ // bit type { // bit type
yyval.Ty = new BitRecTy(); yyval.Ty = new BitRecTy();
; ;
break;} break;}
case 4: case 4:
#line 271 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 271 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ // bits<x> type { // bits<x> type
yyval.Ty = new BitsRecTy(yyvsp[-1].IntVal); yyval.Ty = new BitsRecTy(yyvsp[-1].IntVal);
; ;
break;} break;}
case 5: case 5:
#line 273 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 273 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ // int type { // int type
yyval.Ty = new IntRecTy(); yyval.Ty = new IntRecTy();
; ;
break;} break;}
case 6: case 6:
#line 275 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 275 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ // list<x> type { // list<x> type
yyval.Ty = new ListRecTy(yyvsp[-1].Ty); yyval.Ty = new ListRecTy(yyvsp[-1].Ty);
; ;
break;} break;}
case 7: case 7:
#line 277 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 277 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ // code type { // code type
yyval.Ty = new CodeRecTy(); yyval.Ty = new CodeRecTy();
; ;
break;} break;}
case 8: case 8:
#line 279 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 279 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ // dag type { // dag type
yyval.Ty = new DagRecTy(); yyval.Ty = new DagRecTy();
; ;
break;} break;}
case 9: case 9:
#line 281 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 281 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ // Record Type { // Record Type
yyval.Ty = new RecordRecTy(yyvsp[0].Rec); yyval.Ty = new RecordRecTy(yyvsp[0].Rec);
; ;
break;} break;}
case 10: case 10:
#line 285 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 285 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.IntVal = 0; ; { yyval.IntVal = 0; ;
break;} break;}
case 11: case 11:
#line 285 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 285 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.IntVal = 1; ; { yyval.IntVal = 1; ;
break;} break;}
case 12: case 12:
#line 287 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 287 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.Initializer = 0; ; { yyval.Initializer = 0; ;
break;} break;}
case 13: case 13:
#line 287 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 287 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.Initializer = yyvsp[0].Initializer; ; { yyval.Initializer = yyvsp[0].Initializer; ;
break;} break;}
case 14: case 14:
#line 289 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 289 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
if (const RecordVal *RV = (CurRec ? CurRec->getValue(*yyvsp[0].StrVal) : 0)) { if (const RecordVal *RV = (CurRec ? CurRec->getValue(*yyvsp[0].StrVal) : 0)) {
yyval.Initializer = new VarInit(*yyvsp[0].StrVal, RV->getType()); yyval.Initializer = new VarInit(*yyvsp[0].StrVal, RV->getType());
@ -1170,39 +1170,39 @@ case 14:
; ;
break;} break;}
case 15: case 15:
#line 312 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 312 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = yyvsp[0].Initializer; yyval.Initializer = yyvsp[0].Initializer;
; ;
break;} break;}
case 16: case 16:
#line 314 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 314 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = new IntInit(yyvsp[0].IntVal); yyval.Initializer = new IntInit(yyvsp[0].IntVal);
; ;
break;} break;}
case 17: case 17:
#line 316 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 316 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = new StringInit(*yyvsp[0].StrVal); yyval.Initializer = new StringInit(*yyvsp[0].StrVal);
delete yyvsp[0].StrVal; delete yyvsp[0].StrVal;
; ;
break;} break;}
case 18: case 18:
#line 319 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 319 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = new CodeInit(*yyvsp[0].StrVal); yyval.Initializer = new CodeInit(*yyvsp[0].StrVal);
delete yyvsp[0].StrVal; delete yyvsp[0].StrVal;
; ;
break;} break;}
case 19: case 19:
#line 322 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 322 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = new UnsetInit(); yyval.Initializer = new UnsetInit();
; ;
break;} break;}
case 20: case 20:
#line 324 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 324 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
BitsInit *Init = new BitsInit(yyvsp[-1].FieldList->size()); BitsInit *Init = new BitsInit(yyvsp[-1].FieldList->size());
for (unsigned i = 0, e = yyvsp[-1].FieldList->size(); i != e; ++i) { for (unsigned i = 0, e = yyvsp[-1].FieldList->size(); i != e; ++i) {
@ -1219,7 +1219,7 @@ case 20:
; ;
break;} break;}
case 21: case 21:
#line 337 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 337 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
// This is a CLASS<initvalslist> expression. This is supposed to synthesize // This is a CLASS<initvalslist> expression. This is supposed to synthesize
// a new anonymous definition, deriving from CLASS<initvalslist> with no // a new anonymous definition, deriving from CLASS<initvalslist> with no
@ -1251,7 +1251,7 @@ case 21:
; ;
break;} break;}
case 22: case 22:
#line 365 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 365 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = yyvsp[-3].Initializer->convertInitializerBitRange(*yyvsp[-1].BitList); yyval.Initializer = yyvsp[-3].Initializer->convertInitializerBitRange(*yyvsp[-1].BitList);
if (yyval.Initializer == 0) { if (yyval.Initializer == 0) {
@ -1262,14 +1262,14 @@ case 22:
; ;
break;} break;}
case 23: case 23:
#line 372 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 372 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = new ListInit(*yyvsp[-1].FieldList); yyval.Initializer = new ListInit(*yyvsp[-1].FieldList);
delete yyvsp[-1].FieldList; delete yyvsp[-1].FieldList;
; ;
break;} break;}
case 24: case 24:
#line 375 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 375 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
if (!yyvsp[-2].Initializer->getFieldType(*yyvsp[0].StrVal)) { if (!yyvsp[-2].Initializer->getFieldType(*yyvsp[0].StrVal)) {
err() << "Cannot access field '" << *yyvsp[0].StrVal << "' of value '" << *yyvsp[-2].Initializer << "!\n"; err() << "Cannot access field '" << *yyvsp[0].StrVal << "' of value '" << *yyvsp[-2].Initializer << "!\n";
@ -1280,14 +1280,14 @@ case 24:
; ;
break;} break;}
case 25: case 25:
#line 382 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 382 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = new DagInit(yyvsp[-2].Initializer, *yyvsp[-1].DagValueList); yyval.Initializer = new DagInit(yyvsp[-2].Initializer, *yyvsp[-1].DagValueList);
delete yyvsp[-1].DagValueList; delete yyvsp[-1].DagValueList;
; ;
break;} break;}
case 26: case 26:
#line 385 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 385 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
std::reverse(yyvsp[-1].BitList->begin(), yyvsp[-1].BitList->end()); std::reverse(yyvsp[-1].BitList->begin(), yyvsp[-1].BitList->end());
yyval.Initializer = yyvsp[-3].Initializer->convertInitListSlice(*yyvsp[-1].BitList); yyval.Initializer = yyvsp[-3].Initializer->convertInitListSlice(*yyvsp[-1].BitList);
@ -1299,43 +1299,43 @@ case 26:
; ;
break;} break;}
case 27: case 27:
#line 393 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 393 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = (new BinOpInit(BinOpInit::SHL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold(); yyval.Initializer = (new BinOpInit(BinOpInit::SHL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
; ;
break;} break;}
case 28: case 28:
#line 395 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 395 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = (new BinOpInit(BinOpInit::SRA, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold(); yyval.Initializer = (new BinOpInit(BinOpInit::SRA, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
; ;
break;} break;}
case 29: case 29:
#line 397 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 397 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = (new BinOpInit(BinOpInit::SRL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold(); yyval.Initializer = (new BinOpInit(BinOpInit::SRL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
; ;
break;} break;}
case 30: case 30:
#line 399 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 399 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Initializer = (new BinOpInit(BinOpInit::STRCONCAT, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold(); yyval.Initializer = (new BinOpInit(BinOpInit::STRCONCAT, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
; ;
break;} break;}
case 31: case 31:
#line 403 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 403 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.StrVal = new std::string(); yyval.StrVal = new std::string();
; ;
break;} break;}
case 32: case 32:
#line 406 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 406 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.StrVal = yyvsp[0].StrVal; yyval.StrVal = yyvsp[0].StrVal;
; ;
break;} break;}
case 33: case 33:
#line 410 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 410 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.DagValueList = new std::vector<std::pair<Init*, std::string> >(); yyval.DagValueList = new std::vector<std::pair<Init*, std::string> >();
yyval.DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal)); yyval.DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
@ -1343,7 +1343,7 @@ case 33:
; ;
break;} break;}
case 34: case 34:
#line 415 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 415 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyvsp[-3].DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal)); yyvsp[-3].DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
delete yyvsp[0].StrVal; delete yyvsp[0].StrVal;
@ -1351,24 +1351,24 @@ case 34:
; ;
break;} break;}
case 35: case 35:
#line 421 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 421 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.DagValueList = new std::vector<std::pair<Init*, std::string> >(); yyval.DagValueList = new std::vector<std::pair<Init*, std::string> >();
; ;
break;} break;}
case 36: case 36:
#line 424 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 424 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.DagValueList = yyvsp[0].DagValueList; ; { yyval.DagValueList = yyvsp[0].DagValueList; ;
break;} break;}
case 37: case 37:
#line 427 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 427 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.BitList = new std::vector<unsigned>(); yyval.BitList = new std::vector<unsigned>();
yyval.BitList->push_back(yyvsp[0].IntVal); yyval.BitList->push_back(yyvsp[0].IntVal);
; ;
break;} break;}
case 38: case 38:
#line 430 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 430 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) { if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n"; err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
@ -1385,7 +1385,7 @@ case 38:
; ;
break;} break;}
case 39: case 39:
#line 443 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 443 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyvsp[0].IntVal = -yyvsp[0].IntVal; yyvsp[0].IntVal = -yyvsp[0].IntVal;
if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) { if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
@ -1403,13 +1403,13 @@ case 39:
; ;
break;} break;}
case 40: case 40:
#line 457 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 457 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
(yyval.BitList=yyvsp[-2].BitList)->push_back(yyvsp[0].IntVal); (yyval.BitList=yyvsp[-2].BitList)->push_back(yyvsp[0].IntVal);
; ;
break;} break;}
case 41: case 41:
#line 459 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 459 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) { if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n"; err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
@ -1426,7 +1426,7 @@ case 41:
; ;
break;} break;}
case 42: case 42:
#line 472 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 472 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyvsp[0].IntVal = -yyvsp[0].IntVal; yyvsp[0].IntVal = -yyvsp[0].IntVal;
if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) { if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
@ -1444,44 +1444,44 @@ case 42:
; ;
break;} break;}
case 43: case 43:
#line 488 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 488 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.BitList = yyvsp[0].BitList; std::reverse(yyvsp[0].BitList->begin(), yyvsp[0].BitList->end()); ; { yyval.BitList = yyvsp[0].BitList; std::reverse(yyvsp[0].BitList->begin(), yyvsp[0].BitList->end()); ;
break;} break;}
case 44: case 44:
#line 490 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 490 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.BitList = 0; ; { yyval.BitList = 0; ;
break;} break;}
case 45: case 45:
#line 490 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 490 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.BitList = yyvsp[-1].BitList; ; { yyval.BitList = yyvsp[-1].BitList; ;
break;} break;}
case 46: case 46:
#line 494 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 494 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.FieldList = new std::vector<Init*>(); yyval.FieldList = new std::vector<Init*>();
; ;
break;} break;}
case 47: case 47:
#line 496 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 496 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.FieldList = yyvsp[0].FieldList; yyval.FieldList = yyvsp[0].FieldList;
; ;
break;} break;}
case 48: case 48:
#line 500 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 500 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.FieldList = new std::vector<Init*>(); yyval.FieldList = new std::vector<Init*>();
yyval.FieldList->push_back(yyvsp[0].Initializer); yyval.FieldList->push_back(yyvsp[0].Initializer);
; ;
break;} break;}
case 49: case 49:
#line 503 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 503 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
(yyval.FieldList = yyvsp[-2].FieldList)->push_back(yyvsp[0].Initializer); (yyval.FieldList = yyvsp[-2].FieldList)->push_back(yyvsp[0].Initializer);
; ;
break;} break;}
case 50: case 50:
#line 507 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 507 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
std::string DecName = *yyvsp[-1].StrVal; std::string DecName = *yyvsp[-1].StrVal;
if (ParsingTemplateArgs) { if (ParsingTemplateArgs) {
@ -1500,13 +1500,13 @@ case 50:
; ;
break;} break;}
case 51: case 51:
#line 524 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 524 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
delete yyvsp[-1].StrVal; delete yyvsp[-1].StrVal;
; ;
break;} break;}
case 52: case 52:
#line 526 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 526 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
setValue(*yyvsp[-4].StrVal, yyvsp[-3].BitList, yyvsp[-1].Initializer); setValue(*yyvsp[-4].StrVal, yyvsp[-3].BitList, yyvsp[-1].Initializer);
delete yyvsp[-4].StrVal; delete yyvsp[-4].StrVal;
@ -1514,19 +1514,19 @@ case 52:
; ;
break;} break;}
case 57: case 57:
#line 535 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 535 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.SubClassRef = new SubClassRefTy(yyvsp[0].Rec, new std::vector<Init*>()); yyval.SubClassRef = new SubClassRefTy(yyvsp[0].Rec, new std::vector<Init*>());
; ;
break;} break;}
case 58: case 58:
#line 537 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 537 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.SubClassRef = new SubClassRefTy(yyvsp[-3].Rec, yyvsp[-1].FieldList); yyval.SubClassRef = new SubClassRefTy(yyvsp[-3].Rec, yyvsp[-1].FieldList);
; ;
break;} break;}
case 59: case 59:
#line 541 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 541 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.SubClassList = new std::vector<SubClassRefTy>(); yyval.SubClassList = new std::vector<SubClassRefTy>();
yyval.SubClassList->push_back(*yyvsp[0].SubClassRef); yyval.SubClassList->push_back(*yyvsp[0].SubClassRef);
@ -1534,52 +1534,52 @@ case 59:
; ;
break;} break;}
case 60: case 60:
#line 546 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 546 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
(yyval.SubClassList=yyvsp[-2].SubClassList)->push_back(*yyvsp[0].SubClassRef); (yyval.SubClassList=yyvsp[-2].SubClassList)->push_back(*yyvsp[0].SubClassRef);
delete yyvsp[0].SubClassRef; delete yyvsp[0].SubClassRef;
; ;
break;} break;}
case 61: case 61:
#line 551 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 551 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.SubClassList = new std::vector<SubClassRefTy>(); yyval.SubClassList = new std::vector<SubClassRefTy>();
; ;
break;} break;}
case 62: case 62:
#line 554 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 554 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.SubClassList = yyvsp[0].SubClassList; yyval.SubClassList = yyvsp[0].SubClassList;
; ;
break;} break;}
case 63: case 63:
#line 558 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 558 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
getActiveRec()->addTemplateArg(*yyvsp[0].StrVal); getActiveRec()->addTemplateArg(*yyvsp[0].StrVal);
delete yyvsp[0].StrVal; delete yyvsp[0].StrVal;
; ;
break;} break;}
case 64: case 64:
#line 561 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 561 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
getActiveRec()->addTemplateArg(*yyvsp[0].StrVal); getActiveRec()->addTemplateArg(*yyvsp[0].StrVal);
delete yyvsp[0].StrVal; delete yyvsp[0].StrVal;
; ;
break;} break;}
case 65: case 65:
#line 566 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 566 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{; {;
break;} break;}
case 68: case 68:
#line 569 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 569 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.StrVal = yyvsp[0].StrVal; ; { yyval.StrVal = yyvsp[0].StrVal; ;
break;} break;}
case 69: case 69:
#line 569 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 569 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ yyval.StrVal = new std::string(); ; { yyval.StrVal = new std::string(); ;
break;} break;}
case 70: case 70:
#line 571 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 571 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
static unsigned AnonCounter = 0; static unsigned AnonCounter = 0;
if (yyvsp[0].StrVal->empty()) if (yyvsp[0].StrVal->empty())
@ -1588,7 +1588,7 @@ case 70:
; ;
break;} break;}
case 71: case 71:
#line 578 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 578 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
// If a class of this name already exists, it must be a forward ref. // If a class of this name already exists, it must be a forward ref.
if ((CurRec = Records.getClass(*yyvsp[0].StrVal))) { if ((CurRec = Records.getClass(*yyvsp[0].StrVal))) {
@ -1608,7 +1608,7 @@ case 71:
; ;
break;} break;}
case 72: case 72:
#line 596 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 596 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
CurRec = new Record(*yyvsp[0].StrVal); CurRec = new Record(*yyvsp[0].StrVal);
delete yyvsp[0].StrVal; delete yyvsp[0].StrVal;
@ -1635,16 +1635,16 @@ case 72:
; ;
break;} break;}
case 73: case 73:
#line 621 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 621 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
for (unsigned i = 0, e = yyvsp[0].SubClassList->size(); i != e; ++i) { for (unsigned i = 0, e = yyvsp[0].SubClassList->size(); i != e; ++i) {
addSubClass((*yyvsp[0].SubClassList)[i].first, *(*yyvsp[0].SubClassList)[i].second); addSubClass((*yyvsp[0].SubClassList)[i].first, *(*yyvsp[0].SubClassList)[i].second);
// Delete the template arg values for the class // Delete the template arg values for the class
delete (*yyvsp[0].SubClassList)[i].second; delete (*yyvsp[0].SubClassList)[i].second;
} }
delete yyvsp[0].SubClassList; // Delete the class list... delete yyvsp[0].SubClassList; // Delete the class list.
// Process any variables on the set stack... // Process any variables on the let stack.
for (unsigned i = 0, e = LetStack.size(); i != e; ++i) for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j) for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j)
setValue(LetStack[i][j].Name, setValue(LetStack[i][j].Name,
@ -1653,32 +1653,32 @@ case 73:
; ;
break;} break;}
case 74: case 74:
#line 635 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 635 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Rec = CurRec; yyval.Rec = CurRec;
CurRec = 0; CurRec = 0;
; ;
break;} break;}
case 75: case 75:
#line 640 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 640 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
ParsingTemplateArgs = true; ParsingTemplateArgs = true;
; ;
break;} break;}
case 76: case 76:
#line 642 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 642 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
ParsingTemplateArgs = false; ParsingTemplateArgs = false;
; ;
break;} break;}
case 77: case 77:
#line 644 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 644 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Rec = yyvsp[0].Rec; yyval.Rec = yyvsp[0].Rec;
; ;
break;} break;}
case 78: case 78:
#line 648 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 648 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
if (CurMultiClass == 0) // Def's in multiclasses aren't really defs. if (CurMultiClass == 0) // Def's in multiclasses aren't really defs.
yyvsp[0].Rec->resolveReferences(); yyvsp[0].Rec->resolveReferences();
@ -1689,7 +1689,7 @@ case 78:
; ;
break;} break;}
case 79: case 79:
#line 658 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 658 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.Rec = yyvsp[0].Rec; yyval.Rec = yyvsp[0].Rec;
// Copy the template arguments for the multiclass into the def. // Copy the template arguments for the multiclass into the def.
@ -1703,20 +1703,20 @@ case 79:
; ;
break;} break;}
case 80: case 80:
#line 672 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 672 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.RecList = new std::vector<Record*>(); yyval.RecList = new std::vector<Record*>();
yyval.RecList->push_back(yyvsp[0].Rec); yyval.RecList->push_back(yyvsp[0].Rec);
; ;
break;} break;}
case 81: case 81:
#line 675 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 675 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
yyval.RecList->push_back(yyvsp[0].Rec); yyval.RecList->push_back(yyvsp[0].Rec);
; ;
break;} break;}
case 82: case 82:
#line 679 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 679 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
MultiClass *&MCE = MultiClasses[*yyvsp[0].StrVal]; MultiClass *&MCE = MultiClasses[*yyvsp[0].StrVal];
if (MCE) { if (MCE) {
@ -1728,29 +1728,29 @@ case 82:
; ;
break;} break;}
case 83: case 83:
#line 690 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 690 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
ParsingTemplateArgs = true; ParsingTemplateArgs = true;
; ;
break;} break;}
case 84: case 84:
#line 692 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 692 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
ParsingTemplateArgs = false; ParsingTemplateArgs = false;
; ;
break;} break;}
case 85: case 85:
#line 694 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 694 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
CurMultiClass = 0; CurMultiClass = 0;
; ;
break;} break;}
case 86: case 86:
#line 699 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 699 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ CurDefmPrefix = yyvsp[0].StrVal; ; { CurDefmPrefix = yyvsp[0].StrVal; ;
break;} break;}
case 87: case 87:
#line 699 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 699 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
// To instantiate a multiclass, we need to first get the multiclass, then // To instantiate a multiclass, we need to first get the multiclass, then
// instantiate each def contained in the multiclass with the SubClassRef // instantiate each def contained in the multiclass with the SubClassRef
@ -1798,6 +1798,14 @@ case 87:
} }
} }
// If the mdef is inside a 'let' expression, add to each def.
for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j)
setValue(LetStack[i][j].Name,
LetStack[i][j].HasBits ? &LetStack[i][j].Bits : 0,
LetStack[i][j].Value);
// Ensure redefinition doesn't happen. // Ensure redefinition doesn't happen.
if (Records.getDef(CurRec->getName())) { if (Records.getDef(CurRec->getName())) {
err() << "def '" << CurRec->getName() << "' already defined, " err() << "def '" << CurRec->getName() << "' already defined, "
@ -1818,42 +1826,42 @@ case 87:
; ;
break;} break;}
case 88: case 88:
#line 765 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 773 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{; {;
break;} break;}
case 89: case 89:
#line 765 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 773 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{; {;
break;} break;}
case 92: case 92:
#line 768 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 776 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
LetStack.back().push_back(LetRecord(*yyvsp[-3].StrVal, yyvsp[-2].BitList, yyvsp[0].Initializer)); LetStack.back().push_back(LetRecord(*yyvsp[-3].StrVal, yyvsp[-2].BitList, yyvsp[0].Initializer));
delete yyvsp[-3].StrVal; delete yyvsp[-2].BitList; delete yyvsp[-3].StrVal; delete yyvsp[-2].BitList;
; ;
break;} break;}
case 95: case 95:
#line 776 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 784 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ LetStack.push_back(std::vector<LetRecord>()); ; { LetStack.push_back(std::vector<LetRecord>()); ;
break;} break;}
case 97: case 97:
#line 779 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 787 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
LetStack.pop_back(); LetStack.pop_back();
; ;
break;} break;}
case 98: case 98:
#line 782 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 790 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{ {
LetStack.pop_back(); LetStack.pop_back();
; ;
break;} break;}
case 99: case 99:
#line 786 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 794 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{; {;
break;} break;}
case 100: case 100:
#line 786 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 794 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
{; {;
break;} break;}
} }
@ -2078,7 +2086,7 @@ yyerrhandle:
} }
return 1; return 1;
} }
#line 790 "/Users/sabre/cvs/llvm/utils/TableGen/FileParser.y" #line 798 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
int yyerror(const char *ErrorMsg) { int yyerror(const char *ErrorMsg) {

View File

@ -624,9 +624,9 @@ ObjectBody : ClassList {
// Delete the template arg values for the class // Delete the template arg values for the class
delete (*$1)[i].second; delete (*$1)[i].second;
} }
delete $1; // Delete the class list... delete $1; // Delete the class list.
// Process any variables on the set stack... // Process any variables on the let stack.
for (unsigned i = 0, e = LetStack.size(); i != e; ++i) for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j) for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j)
setValue(LetStack[i][j].Name, setValue(LetStack[i][j].Name,
@ -743,6 +743,14 @@ DefMInst : DEFM ID { CurDefmPrefix = $2; } ':' SubClassRef ';' {
} }
} }
// If the mdef is inside a 'let' expression, add to each def.
for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j)
setValue(LetStack[i][j].Name,
LetStack[i][j].HasBits ? &LetStack[i][j].Bits : 0,
LetStack[i][j].Value);
// Ensure redefinition doesn't happen. // Ensure redefinition doesn't happen.
if (Records.getDef(CurRec->getName())) { if (Records.getDef(CurRec->getName())) {
err() << "def '" << CurRec->getName() << "' already defined, " err() << "def '" << CurRec->getName() << "' already defined, "