[llvm-commits] CVS: llvm/utils/TableGen/FileParser.y

Chris Lattner lattner at cs.uiuc.edu
Sun Sep 11 22:29:54 PDT 2005



Changes in directory llvm/utils/TableGen:

FileParser.y updated: 1.35 -> 1.36
---
Log message:

Rearrange two rules, which apparently makes some versions of bison happier.


---
Diffs of the changes:  (+15 -15)

 FileParser.y |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)


Index: llvm/utils/TableGen/FileParser.y
diff -u llvm/utils/TableGen/FileParser.y:1.35 llvm/utils/TableGen/FileParser.y:1.36
--- llvm/utils/TableGen/FileParser.y:1.35	Thu Sep  8 13:48:23 2005
+++ llvm/utils/TableGen/FileParser.y	Mon Sep 12 00:29:43 2005
@@ -276,21 +276,6 @@
     }
     $$ = Init;
     delete $2;
-  } | ID {
-    if (const RecordVal *RV = (CurRec ? CurRec->getValue(*$1) : 0)) {
-      $$ = new VarInit(*$1, RV->getType());
-    } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*$1)) {
-      const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*$1);
-      assert(RV && "Template arg doesn't exist??");
-      $$ = new VarInit(CurRec->getName()+":"+*$1, RV->getType());
-    } else if (Record *D = Records.getDef(*$1)) {
-      $$ = new DefInit(D);
-    } else {
-      err() << "Variable not defined: '" << *$1 << "'!\n";
-      exit(1);
-    }
-    
-    delete $1;
   } | ID '<' ValueListNE '>' {
     // This is a CLASS<initvalslist> expression.  This is supposed to synthesize
     // a new anonymous definition, deriving from CLASS<initvalslist> with no
@@ -319,6 +304,21 @@
     
     // Restore the old CurRec
     CurRec = OldRec;
+  } | ID {
+    if (const RecordVal *RV = (CurRec ? CurRec->getValue(*$1) : 0)) {
+      $$ = new VarInit(*$1, RV->getType());
+    } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*$1)) {
+      const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*$1);
+      assert(RV && "Template arg doesn't exist??");
+      $$ = new VarInit(CurRec->getName()+":"+*$1, RV->getType());
+    } else if (Record *D = Records.getDef(*$1)) {
+      $$ = new DefInit(D);
+    } else {
+      err() << "Variable not defined: '" << *$1 << "'!\n";
+      exit(1);
+    }
+    
+    delete $1;
   } | Value '{' BitList '}' {
     $$ = $1->convertInitializerBitRange(*$3);
     if ($$ == 0) {






More information about the llvm-commits mailing list