diff options
author | Chris Lattner <sabre@nondot.org> | 2005-09-12 05:29:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-09-12 05:29:43 +0000 |
commit | 2fc4f120c6bee4e06ec3ac0e5f66e5961a306658 (patch) | |
tree | 336f3279e14b5699006de0351f83f1e971343ffb | |
parent | 6b780a702e12b3d18ff07afbf9a8a07f2f5d1f40 (diff) |
Rearrange two rules, which apparently makes some versions of bison happier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23310 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/FileParser.y | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/utils/TableGen/FileParser.y b/utils/TableGen/FileParser.y index 319b0e3695..f5357340ca 100644 --- a/utils/TableGen/FileParser.y +++ b/utils/TableGen/FileParser.y @@ -276,21 +276,6 @@ Value : INTVAL { } $$ = 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 @@ Value : INTVAL { // 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) { |