diff --git a/utils/TableGen/FileParser.cpp.cvs b/utils/TableGen/FileParser.cpp.cvs
new file mode 100644
index 0000000..6cfc3dd
--- /dev/null
+++ b/utils/TableGen/FileParser.cpp.cvs
@@ -0,0 +1,2863 @@
+/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Bison version.  */
+#define YYBISON_VERSION "2.3"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+/* Substitute the variable and function names.  */
+#define yyparse Fileparse
+#define yylex   Filelex
+#define yyerror Fileerror
+#define yylval  Filelval
+#define yychar  Filechar
+#define yydebug Filedebug
+#define yynerrs Filenerrs
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     INT = 258,
+     BIT = 259,
+     STRING = 260,
+     BITS = 261,
+     LIST = 262,
+     CODE = 263,
+     DAG = 264,
+     CLASS = 265,
+     DEF = 266,
+     MULTICLASS = 267,
+     DEFM = 268,
+     FIELD = 269,
+     LET = 270,
+     IN = 271,
+     SHLTOK = 272,
+     SRATOK = 273,
+     SRLTOK = 274,
+     STRCONCATTOK = 275,
+     INTVAL = 276,
+     ID = 277,
+     VARNAME = 278,
+     STRVAL = 279,
+     CODEFRAGMENT = 280
+   };
+#endif
+/* Tokens.  */
+#define INT 258
+#define BIT 259
+#define STRING 260
+#define BITS 261
+#define LIST 262
+#define CODE 263
+#define DAG 264
+#define CLASS 265
+#define DEF 266
+#define MULTICLASS 267
+#define DEFM 268
+#define FIELD 269
+#define LET 270
+#define IN 271
+#define SHLTOK 272
+#define SRATOK 273
+#define SRLTOK 274
+#define STRCONCATTOK 275
+#define INTVAL 276
+#define ID 277
+#define VARNAME 278
+#define STRVAL 279
+#define CODEFRAGMENT 280
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 14 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+
+#include "Record.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/Streams.h"
+#include <algorithm>
+#include <cstdio>
+#define YYERROR_VERBOSE 1
+
+int yyerror(const char *ErrorMsg);
+int yylex();
+
+namespace llvm {
+  struct MultiClass {
+    Record Rec;  // Placeholder for template args and Name.
+    std::vector<Record*> DefPrototypes;
+    
+    MultiClass(const std::string &Name) : Rec(Name) {}
+  };
+
+  
+static std::map<std::string, MultiClass*> MultiClasses;
+  
+extern int Filelineno;
+static MultiClass *CurMultiClass = 0;    // Set while parsing a multiclass.
+static std::string *CurDefmPrefix = 0;   // Set while parsing defm.
+static Record *CurRec = 0;
+static bool ParsingTemplateArgs = false;
+
+typedef std::pair<Record*, std::vector<Init*>*> SubClassRefTy;
+
+struct LetRecord {
+  std::string Name;
+  std::vector<unsigned> Bits;
+  Init *Value;
+  bool HasBits;
+  LetRecord(const std::string &N, std::vector<unsigned> *B, Init *V)
+    : Name(N), Value(V), HasBits(B != 0) {
+    if (HasBits) Bits = *B;
+  }
+};
+
+static std::vector<std::vector<LetRecord> > LetStack;
+
+
+extern std::ostream &err();
+
+/// getActiveRec - If inside a def/class definition, return the def/class.
+/// Otherwise, if within a multidef, return it.
+static Record *getActiveRec() {
+  return CurRec ? CurRec : &CurMultiClass->Rec;
+}
+
+static void addValue(const RecordVal &RV) {
+  Record *TheRec = getActiveRec();
+  
+  if (RecordVal *ERV = TheRec->getValue(RV.getName())) {
+    // The value already exists in the class, treat this as a set...
+    if (ERV->setValue(RV.getValue())) {
+      err() << "New definition of '" << RV.getName() << "' of type '"
+            << *RV.getType() << "' is incompatible with previous "
+            << "definition of type '" << *ERV->getType() << "'!\n";
+      exit(1);
+    }
+  } else {
+    TheRec->addValue(RV);
+  }
+}
+
+static void addSuperClass(Record *SC) {
+  if (CurRec->isSubClassOf(SC)) {
+    err() << "Already subclass of '" << SC->getName() << "'!\n";
+    exit(1);
+  }
+  CurRec->addSuperClass(SC);
+}
+
+static void setValue(const std::string &ValName, 
+                     std::vector<unsigned> *BitList, Init *V) {
+  if (!V) return;
+
+  Record *TheRec = getActiveRec();
+  RecordVal *RV = TheRec->getValue(ValName);
+  if (RV == 0) {
+    err() << "Value '" << ValName << "' unknown!\n";
+    exit(1);
+  }
+
+  // Do not allow assignments like 'X = X'.  This will just cause infinite loops
+  // in the resolution machinery.
+  if (!BitList)
+    if (VarInit *VI = dynamic_cast<VarInit*>(V))
+      if (VI->getName() == ValName)
+        return;
+  
+  // If we are assigning to a subset of the bits in the value... then we must be
+  // assigning to a field of BitsRecTy, which must have a BitsInit
+  // initializer...
+  //
+  if (BitList) {
+    BitsInit *CurVal = dynamic_cast<BitsInit*>(RV->getValue());
+    if (CurVal == 0) {
+      err() << "Value '" << ValName << "' is not a bits type!\n";
+      exit(1);
+    }
+
+    // Convert the incoming value to a bits type of the appropriate size...
+    Init *BI = V->convertInitializerTo(new BitsRecTy(BitList->size()));
+    if (BI == 0) {
+      V->convertInitializerTo(new BitsRecTy(BitList->size()));
+      err() << "Initializer '" << *V << "' not compatible with bit range!\n";
+      exit(1);
+    }
+
+    // We should have a BitsInit type now...
+    assert(dynamic_cast<BitsInit*>(BI) != 0 || (cerr << *BI).stream() == 0);
+    BitsInit *BInit = (BitsInit*)BI;
+
+    BitsInit *NewVal = new BitsInit(CurVal->getNumBits());
+
+    // Loop over bits, assigning values as appropriate...
+    for (unsigned i = 0, e = BitList->size(); i != e; ++i) {
+      unsigned Bit = (*BitList)[i];
+      if (NewVal->getBit(Bit)) {
+        err() << "Cannot set bit #" << Bit << " of value '" << ValName
+              << "' more than once!\n";
+        exit(1);
+      }
+      NewVal->setBit(Bit, BInit->getBit(i));
+    }
+
+    for (unsigned i = 0, e = CurVal->getNumBits(); i != e; ++i)
+      if (NewVal->getBit(i) == 0)
+        NewVal->setBit(i, CurVal->getBit(i));
+
+    V = NewVal;
+  }
+
+  if (RV->setValue(V)) {
+    err() << "Value '" << ValName << "' of type '" << *RV->getType()
+	  << "' is incompatible with initializer '" << *V << "'!\n";
+    exit(1);
+  }
+}
+
+// addSubClass - Add SC as a subclass to CurRec, resolving TemplateArgs as SC's
+// template arguments.
+static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
+  // Add all of the values in the subclass into the current class...
+  const std::vector<RecordVal> &Vals = SC->getValues();
+  for (unsigned i = 0, e = Vals.size(); i != e; ++i)
+    addValue(Vals[i]);
+
+  const std::vector<std::string> &TArgs = SC->getTemplateArgs();
+
+  // Ensure that an appropriate number of template arguments are specified...
+  if (TArgs.size() < TemplateArgs.size()) {
+    err() << "ERROR: More template args specified than expected!\n";
+    exit(1);
+  }
+  
+  // Loop over all of the template arguments, setting them to the specified
+  // value or leaving them as the default if necessary.
+  for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
+    if (i < TemplateArgs.size()) {  // A value is specified for this temp-arg?
+      // Set it now.
+      setValue(TArgs[i], 0, TemplateArgs[i]);
+
+      // Resolve it next.
+      CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i]));
+                                  
+      
+      // Now remove it.
+      CurRec->removeValue(TArgs[i]);
+
+    } else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
+      err() << "ERROR: Value not specified for template argument #"
+            << i << " (" << TArgs[i] << ") of subclass '" << SC->getName()
+            << "'!\n";
+      exit(1);
+    }
+  }
+
+  // Since everything went well, we can now set the "superclass" list for the
+  // current record.
+  const std::vector<Record*> &SCs = SC->getSuperClasses();
+  for (unsigned i = 0, e = SCs.size(); i != e; ++i)
+    addSuperClass(SCs[i]);
+  addSuperClass(SC);
+}
+
+} // End llvm namespace
+
+using namespace llvm;
+
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 210 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+{
+  std::string*                StrVal;
+  int                         IntVal;
+  llvm::RecTy*                Ty;
+  llvm::Init*                 Initializer;
+  std::vector<llvm::Init*>*   FieldList;
+  std::vector<unsigned>*      BitList;
+  llvm::Record*               Rec;
+  std::vector<llvm::Record*>* RecList;
+  SubClassRefTy*              SubClassRef;
+  std::vector<SubClassRefTy>* SubClassList;
+  std::vector<std::pair<llvm::Init*, std::string> >* DagValueList;
+}
+/* Line 193 of yacc.c.  */
+#line 364 "FileParser.tab.c"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 216 of yacc.c.  */
+#line 377 "FileParser.tab.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# ifdef YYSTACK_USE_ALLOCA
+#  if YYSTACK_USE_ALLOCA
+#   ifdef __GNUC__
+#    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
+#   else
+#    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+#  endif
+# else
+#  define YYSTACK_ALLOC YYMALLOC
+#  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  yytype_int16 yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  YYSIZE_T yyi;				\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (YYID (0))
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (YYID (0))
+
+#endif
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  27
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   204
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  41
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  50
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  102
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  188
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   280
+
+#define YYTRANSLATE(YYX)						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const yytype_uint8 yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+      35,    36,     2,     2,    37,    39,    34,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    38,    40,
+      26,    28,    27,    29,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,    32,     2,    33,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    30,     2,    31,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+      25
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint16 yyprhs[] =
+{
+       0,     0,     3,     5,     7,     9,    14,    16,    21,    23,
+      25,    27,    28,    30,    31,    34,    36,    38,    40,    42,
+      44,    46,    50,    55,    60,    64,    68,    73,    78,    85,
+      92,    99,   106,   107,   110,   113,   118,   119,   121,   123,
+     127,   130,   134,   140,   145,   147,   148,   152,   153,   155,
+     157,   161,   166,   169,   176,   177,   180,   182,   186,   188,
+     193,   195,   199,   200,   203,   205,   209,   213,   214,   216,
+     218,   219,   221,   223,   225,   226,   230,   231,   232,   239,
+     243,   245,   247,   250,   252,   253,   254,   263,   264,   271,
+     273,   275,   277,   279,   284,   286,   290,   291,   296,   301,
+     304,   306,   309
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
+{
+      90,     0,    -1,    22,    -1,     5,    -1,     4,    -1,     6,
+      26,    21,    27,    -1,     3,    -1,     7,    26,    43,    27,
+      -1,     8,    -1,     9,    -1,    42,    -1,    -1,    14,    -1,
+      -1,    28,    47,    -1,    22,    -1,    46,    -1,    21,    -1,
+      24,    -1,    25,    -1,    29,    -1,    30,    54,    31,    -1,
+      22,    26,    55,    27,    -1,    47,    30,    52,    31,    -1,
+      32,    54,    33,    -1,    47,    34,    22,    -1,    35,    46,
+      50,    36,    -1,    47,    32,    52,    33,    -1,    17,    35,
+      47,    37,    47,    36,    -1,    18,    35,    47,    37,    47,
+      36,    -1,    19,    35,    47,    37,    47,    36,    -1,    20,
+      35,    47,    37,    47,    36,    -1,    -1,    38,    23,    -1,
+      47,    48,    -1,    49,    37,    47,    48,    -1,    -1,    49,
+      -1,    21,    -1,    21,    39,    21,    -1,    21,    21,    -1,
+      51,    37,    21,    -1,    51,    37,    21,    39,    21,    -1,
+      51,    37,    21,    21,    -1,    51,    -1,    -1,    30,    52,
+      31,    -1,    -1,    55,    -1,    47,    -1,    55,    37,    47,
+      -1,    44,    43,    22,    45,    -1,    56,    40,    -1,    15,
+      22,    53,    28,    47,    40,    -1,    -1,    58,    57,    -1,
+      40,    -1,    30,    58,    31,    -1,    42,    -1,    42,    26,
+      55,    27,    -1,    60,    -1,    61,    37,    60,    -1,    -1,
+      38,    61,    -1,    56,    -1,    63,    37,    56,    -1,    26,
+      63,    27,    -1,    -1,    64,    -1,    22,    -1,    -1,    66,
+      -1,    67,    -1,    67,    -1,    -1,    62,    71,    59,    -1,
+      -1,    -1,    10,    68,    73,    65,    74,    70,    -1,    11,
+      69,    70,    -1,    75,    -1,    76,    -1,    77,    76,    -1,
+      22,    -1,    -1,    -1,    12,    78,    80,    65,    81,    30,
+      77,    31,    -1,    -1,    13,    22,    83,    38,    60,    40,
+      -1,    72,    -1,    75,    -1,    79,    -1,    82,    -1,    22,
+      53,    28,    47,    -1,    85,    -1,    86,    37,    85,    -1,
+      -1,    15,    88,    86,    16,    -1,    87,    30,    89,    31,
+      -1,    87,    84,    -1,    84,    -1,    89,    84,    -1,    89,
+      -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,   246,   246,   268,   270,   272,   274,   276,   278,   280,
+     282,   286,   286,   288,   288,   290,   313,   315,   317,   320,
+     323,   325,   338,   366,   373,   376,   383,   386,   394,   396,
+     398,   400,   404,   407,   411,   416,   422,   425,   428,   431,
+     444,   458,   460,   473,   489,   491,   491,   495,   497,   501,
+     504,   508,   525,   527,   533,   533,   534,   534,   536,   538,
+     542,   547,   552,   555,   559,   562,   567,   568,   568,   570,
+     570,   572,   579,   597,   622,   622,   641,   643,   641,   649,
+     659,   673,   676,   680,   691,   693,   691,   700,   700,   774,
+     774,   775,   775,   777,   782,   782,   785,   785,   788,   791,
+     795,   795,   797
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "INT", "BIT", "STRING", "BITS", "LIST",
+  "CODE", "DAG", "CLASS", "DEF", "MULTICLASS", "DEFM", "FIELD", "LET",
+  "IN", "SHLTOK", "SRATOK", "SRLTOK", "STRCONCATTOK", "INTVAL", "ID",
+  "VARNAME", "STRVAL", "CODEFRAGMENT", "'<'", "'>'", "'='", "'?'", "'{'",
+  "'}'", "'['", "']'", "'.'", "'('", "')'", "','", "':'", "'-'", "';'",
+  "$accept", "ClassID", "Type", "OptPrefix", "OptValue", "IDValue",
+  "Value", "OptVarName", "DagArgListNE", "DagArgList", "RBitList",
+  "BitList", "OptBitList", "ValueList", "ValueListNE", "Declaration",
+  "BodyItem", "BodyList", "Body", "SubClassRef", "ClassListNE",
+  "ClassList", "DeclListNE", "TemplateArgList", "OptTemplateArgList",
+  "OptID", "ObjectName", "ClassName", "DefName", "ObjectBody", "@1",
+  "ClassInst", "@2", "@3", "DefInst", "MultiClassDef", "MultiClassBody",
+  "MultiClassName", "MultiClassInst", "@4", "@5", "DefMInst", "@6",
+  "Object", "LETItem", "LETList", "LETCommand", "@7", "ObjectList", "File", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,    60,    62,    61,    63,
+     123,   125,    91,    93,    46,    40,    41,    44,    58,    45,
+      59
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    41,    42,    43,    43,    43,    43,    43,    43,    43,
+      43,    44,    44,    45,    45,    46,    47,    47,    47,    47,
+      47,    47,    47,    47,    47,    47,    47,    47,    47,    47,
+      47,    47,    48,    48,    49,    49,    50,    50,    51,    51,
+      51,    51,    51,    51,    52,    53,    53,    54,    54,    55,
+      55,    56,    57,    57,    58,    58,    59,    59,    60,    60,
+      61,    61,    62,    62,    63,    63,    64,    65,    65,    66,
+      66,    67,    68,    69,    71,    70,    73,    74,    72,    75,
+      76,    77,    77,    78,    80,    81,    79,    83,    82,    84,
+      84,    84,    84,    85,    86,    86,    88,    87,    84,    84,
+      89,    89,    90
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     1,     1,     1,     4,     1,     4,     1,     1,
+       1,     0,     1,     0,     2,     1,     1,     1,     1,     1,
+       1,     3,     4,     4,     3,     3,     4,     4,     6,     6,
+       6,     6,     0,     2,     2,     4,     0,     1,     1,     3,
+       2,     3,     5,     4,     1,     0,     3,     0,     1,     1,
+       3,     4,     2,     6,     0,     2,     1,     3,     1,     4,
+       1,     3,     0,     2,     1,     3,     3,     0,     1,     1,
+       0,     1,     1,     1,     0,     3,     0,     0,     6,     3,
+       1,     1,     2,     1,     0,     0,     8,     0,     6,     1,
+       1,     1,     1,     4,     1,     3,     0,     4,     4,     2,
+       1,     2,     1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       0,    70,    70,     0,     0,    96,    89,    90,    91,    92,
+     100,     0,   102,     0,    69,    71,    72,    76,    73,    62,
+      83,    84,    87,     0,     0,    99,   101,     1,    67,     0,
+      74,    79,    67,     0,    45,    94,     0,     0,    11,    68,
+      77,     2,    58,    60,    63,     0,    85,     0,     0,     0,
+      97,     0,    98,    12,     0,    64,     0,    62,     0,     0,
+      54,    56,    75,     0,     0,    38,    44,     0,     0,    95,
+       6,     4,     3,     0,     0,     8,     9,    10,     0,    66,
+      11,    78,     0,     0,     0,     0,    17,    15,    18,    19,
+      20,    47,    47,     0,    16,    49,     0,    61,    11,     0,
+      88,    40,     0,     0,    46,    93,     0,     0,    13,    65,
+       0,     0,     0,     0,     0,     0,    48,     0,    15,    36,
+       0,     0,     0,    59,     0,     0,    57,     0,    55,    80,
+      81,     0,    39,    41,     0,     0,     0,    51,     0,     0,
+       0,     0,     0,    21,    24,    32,    37,     0,     0,     0,
+      25,    50,    45,    52,    86,    82,    43,     0,     5,     7,
+      14,     0,     0,     0,     0,    22,     0,    34,     0,    26,
+      23,    27,     0,    42,     0,     0,     0,     0,    33,    32,
+       0,    28,    29,    30,    31,    35,     0,    53
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,    42,    78,    54,   137,    94,    95,   167,   146,   147,
+      66,    67,    49,   115,   116,    55,   128,    98,    62,    43,
+      44,    30,    56,    39,    40,    15,    16,    17,    19,    31,
+      45,     6,    28,    57,     7,   130,   131,    21,     8,    32,
+      63,     9,    33,    10,    35,    36,    11,    23,    12,    13
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -97
+static const yytype_int16 yypact[] =
+{
+     129,     3,     3,    11,    19,   -97,   -97,   -97,   -97,   -97,
+     -97,     2,   129,    48,   -97,   -97,   -97,   -97,   -97,    29,
+     -97,   -97,   -97,    31,   129,   -97,   -97,   -97,    43,    56,
+     -97,   -97,    43,    42,    53,   -97,    -6,    -4,    71,   -97,
+     -97,   -97,    72,   -97,    65,     9,   -97,    56,    87,    78,
+     -97,    31,   -97,   -97,    15,   -97,    13,    29,    41,    56,
+     -97,   -97,   -97,    84,    80,     7,    81,   106,    41,   -97,
+     -97,   -97,   -97,   120,   122,   -97,   -97,   -97,   127,   -97,
+      71,   -97,   115,   116,   117,   118,   -97,   128,   -97,   -97,
+     -97,    41,    41,   133,   -97,   113,    27,   -97,    60,   145,
+     -97,   -97,   136,   137,   -97,   113,   138,    15,   132,   -97,
+      41,    41,    41,    41,    41,   130,   125,   131,   -97,    41,
+      87,    87,   141,   -97,    41,   143,   -97,   126,   -97,   -97,
+     -97,     5,   -97,     8,   140,   142,    41,   -97,    67,    73,
+      79,    85,    45,   -97,   -97,    54,   134,   139,   146,   135,
+     -97,   113,    53,   -97,   -97,   -97,   -97,   149,   -97,   -97,
+     113,    41,    41,    41,    41,   -97,   150,   -97,    41,   -97,
+     -97,   -97,   144,   -97,    91,    94,    99,   102,   -97,    54,
+      41,   -97,   -97,   -97,   -97,   -97,    47,   -97
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+     -97,   -52,    69,   -97,   -97,    86,   -68,    -5,   -97,   -97,
+     -97,   -31,    26,    88,   -57,   -46,   -97,   -97,   -97,   -21,
+     -97,   -97,   -97,   -97,   151,   -97,   179,   -97,   -97,   147,
+     -97,   -97,   -97,   -97,   -96,    51,   -97,   -97,   -97,   -97,
+     -97,   -97,   -97,    -7,   148,   -97,   -97,   -97,   160,   -97
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -1
+static const yytype_uint8 yytable[] =
+{
+     105,    96,    77,   129,    25,    26,     1,     2,     3,     4,
+      50,     5,     1,     2,     3,     4,     2,     5,    70,    71,
+      72,    73,    74,    75,    76,    14,    64,    52,   101,   156,
+      26,    51,    24,    20,   109,   129,   154,    41,    97,    60,
+      79,    22,   138,   139,   140,   141,   102,   157,    27,    61,
+      80,   145,   127,    34,   123,    77,   151,   142,    82,    83,
+      84,    85,    86,    87,   124,    88,    89,    29,   160,    38,
+      90,    91,   165,    92,    53,   125,    93,   120,    41,   121,
+      47,   122,   124,    48,   120,    53,   121,   187,   122,   148,
+     149,   126,   166,   174,   175,   176,   177,   120,    58,   121,
+     179,   122,    59,   120,   161,   121,    68,   122,    65,   120,
+     162,   121,   186,   122,    99,   120,   163,   121,   103,   122,
+     100,   120,   164,   121,   120,   122,   121,   181,   122,   120,
+     182,   121,   120,   122,   121,   183,   122,   104,   184,     1,
+       2,     3,     4,   120,     5,   121,   106,   122,   107,   108,
+     110,   111,   112,   113,   114,   118,     2,   132,   133,   134,
+     136,   143,   124,   150,   144,   152,   153,   158,   171,   159,
+     173,   168,   180,   178,   185,   169,   135,   170,   172,   119,
+     117,    18,   155,    46,    37,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,    69,
+       0,     0,     0,     0,    81
+};
+
+static const yytype_int16 yycheck[] =
+{
+      68,    58,    54,    99,    11,    12,    10,    11,    12,    13,
+      16,    15,    10,    11,    12,    13,    11,    15,     3,     4,
+       5,     6,     7,     8,     9,    22,    47,    31,    21,    21,
+      37,    37,    30,    22,    80,   131,    31,    22,    59,    30,
+      27,    22,   110,   111,   112,   113,    39,    39,     0,    40,
+      37,   119,    98,    22,    27,   107,   124,   114,    17,    18,
+      19,    20,    21,    22,    37,    24,    25,    38,   136,    26,
+      29,    30,    27,    32,    14,    15,    35,    30,    22,    32,
+      38,    34,    37,    30,    30,    14,    32,    40,    34,   120,
+     121,    31,    38,   161,   162,   163,   164,    30,    26,    32,
+     168,    34,    37,    30,    37,    32,    28,    34,    21,    30,
+      37,    32,   180,    34,    30,    30,    37,    32,    37,    34,
+      40,    30,    37,    32,    30,    34,    32,    36,    34,    30,
+      36,    32,    30,    34,    32,    36,    34,    31,    36,    10,
+      11,    12,    13,    30,    15,    32,    26,    34,    26,    22,
+      35,    35,    35,    35,    26,    22,    11,    21,    21,    21,
+      28,    31,    37,    22,    33,    22,    40,    27,    33,    27,
+      21,    37,    28,    23,   179,    36,   107,    31,   152,    93,
+      92,     2,   131,    32,    24,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    51,
+      -1,    -1,    -1,    -1,    57
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    10,    11,    12,    13,    15,    72,    75,    79,    82,
+      84,    87,    89,    90,    22,    66,    67,    68,    67,    69,
+      22,    78,    22,    88,    30,    84,    84,     0,    73,    38,
+      62,    70,    80,    83,    22,    85,    86,    89,    26,    64,
+      65,    22,    42,    60,    61,    71,    65,    38,    30,    53,
+      16,    37,    31,    14,    44,    56,    63,    74,    26,    37,
+      30,    40,    59,    81,    60,    21,    51,    52,    28,    85,
+       3,     4,     5,     6,     7,     8,     9,    42,    43,    27,
+      37,    70,    17,    18,    19,    20,    21,    22,    24,    25,
+      29,    30,    32,    35,    46,    47,    55,    60,    58,    30,
+      40,    21,    39,    37,    31,    47,    26,    26,    22,    56,
+      35,    35,    35,    35,    26,    54,    55,    54,    22,    46,
+      30,    32,    34,    27,    37,    15,    31,    56,    57,    75,
+      76,    77,    21,    21,    21,    43,    28,    45,    47,    47,
+      47,    47,    55,    31,    33,    47,    49,    50,    52,    52,
+      22,    47,    22,    40,    31,    76,    21,    39,    27,    27,
+      47,    37,    37,    37,    37,    27,    38,    48,    37,    36,
+      31,    33,    53,    21,    47,    47,    47,    47,    23,    47,
+      28,    36,    36,    36,    36,    48,    47,    40
+};
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (YY_("syntax error: cannot back up")); \
+      YYERROR;							\
+    }								\
+while (YYID (0))
+
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)				\
+    do									\
+      if (YYID (N))                                                    \
+	{								\
+	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
+	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
+	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
+	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
+	}								\
+      else								\
+	{								\
+	  (Current).first_line   = (Current).last_line   =		\
+	    YYRHSLOC (Rhs, 0).last_line;				\
+	  (Current).first_column = (Current).last_column =		\
+	    YYRHSLOC (Rhs, 0).last_column;				\
+	}								\
+    while (YYID (0))
+#endif
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (YYID (0))
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
+do {									  \
+  if (yydebug)								  \
+    {									  \
+      YYFPRINTF (stderr, "%s ", Title);					  \
+      yy_symbol_print (stderr,						  \
+		  Type, Value); \
+      YYFPRINTF (stderr, "\n");						  \
+    }									  \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+	break;
+    }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included).                                                   |
+`------------------------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    yytype_int16 *bottom;
+    yytype_int16 *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (YYID (0))
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
+#endif
+{
+  int yynrhs = yyr2[yyrule];
+  int yyi;
+  unsigned long int yylno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+	     yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       );
+      fprintf (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined __GLIBC__ && defined _STRING_H
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static YYSIZE_T
+yystrlen (const char *yystr)
+#else
+static YYSIZE_T
+yystrlen (yystr)
+    const char *yystr;
+#endif
+{
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
+    continue;
+  return yylen;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+#else
+static char *
+yystpcpy (yydest, yysrc)
+    char *yydest;
+    const char *yysrc;
+#endif
+{
+  char *yyd = yydest;
+  const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
+    {
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
+
+      for (;;)
+	switch (*++yyp)
+	  {
+	  case '\'':
+	  case ',':
+	    goto do_not_strip_quotes;
+
+	  case '\\':
+	    if (*++yyp != '\\')
+	      goto do_not_strip_quotes;
+	    /* Fall through.  */
+	  default:
+	    if (yyres)
+	      yyres[yyn] = *yyp;
+	    yyn++;
+	    break;
+
+	  case '"':
+	    if (yyres)
+	      yyres[yyn] = '\0';
+	    return yyn;
+	  }
+    do_not_strip_quotes: ;
+    }
+
+  if (! yyres)
+    return yystrlen (yystr);
+
+  return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* Avoid sprintf, as that infringes on the user's name space.
+	     Don't have undefined behavior even if the translation
+	     produced a string with the wrong number of "%s"s.  */
+	  char *yyp = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
+    }
+}
+#endif /* YYERROR_VERBOSE */
+
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  if (!yymsg)
+    yymsg = "Deleting";
+  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+  switch (yytype)
+    {
+
+      default:
+	break;
+    }
+}
+
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The look-ahead symbol.  */
+int yychar;
+
+/* The semantic value of the look-ahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
+#else /* ! YYPARSE_PARAM */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  int yystate;
+  int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Look-ahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed.  So pushing a state here evens the stacks.  */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+	/* Give user a chance to reallocate the stack.  Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	yytype_int16 *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow (YY_("memory exhausted"),
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyexhaustedlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyexhaustedlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	yytype_int16 *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyexhaustedlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to look-ahead token.  */
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a look-ahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the look-ahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  yystate = yyn;
+  *++yyvsp = yylval;
+
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 2:
+#line 246 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    if (CurDefmPrefix) {
+      // If CurDefmPrefix is set, we're parsing a defm, which means that this is
+      // actually the name of a multiclass.
+      MultiClass *MC = MultiClasses[*(yyvsp[(1) - (1)].StrVal)];
+      if (MC == 0) {
+        err() << "Couldn't find class '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+        exit(1);
+      }
+      (yyval.Rec) = &MC->Rec;
+    } else {
+      (yyval.Rec) = Records.getClass(*(yyvsp[(1) - (1)].StrVal));
+    }
+    if ((yyval.Rec) == 0) {
+      err() << "Couldn't find class '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+      exit(1);
+    }
+    delete (yyvsp[(1) - (1)].StrVal);
+  ;}
+    break;
+
+  case 3:
+#line 268 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {                       // string type
+    (yyval.Ty) = new StringRecTy();
+  ;}
+    break;
+
+  case 4:
+#line 270 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {                           // bit type
+    (yyval.Ty) = new BitRecTy();
+  ;}
+    break;
+
+  case 5:
+#line 272 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {           // bits<x> type
+    (yyval.Ty) = new BitsRecTy((yyvsp[(3) - (4)].IntVal));
+  ;}
+    break;
+
+  case 6:
+#line 274 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {                           // int type
+    (yyval.Ty) = new IntRecTy();
+  ;}
+    break;
+
+  case 7:
+#line 276 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {          // list<x> type
+    (yyval.Ty) = new ListRecTy((yyvsp[(3) - (4)].Ty));
+  ;}
+    break;
+
+  case 8:
+#line 278 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {                          // code type
+    (yyval.Ty) = new CodeRecTy();
+  ;}
+    break;
+
+  case 9:
+#line 280 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {                           // dag type
+    (yyval.Ty) = new DagRecTy();
+  ;}
+    break;
+
+  case 10:
+#line 282 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {                       // Record Type
+    (yyval.Ty) = new RecordRecTy((yyvsp[(1) - (1)].Rec));
+  ;}
+    break;
+
+  case 11:
+#line 286 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.IntVal) = 0; ;}
+    break;
+
+  case 12:
+#line 286 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.IntVal) = 1; ;}
+    break;
+
+  case 13:
+#line 288 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.Initializer) = 0; ;}
+    break;
+
+  case 14:
+#line 288 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.Initializer) = (yyvsp[(2) - (2)].Initializer); ;}
+    break;
+
+  case 15:
+#line 290 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  if (const RecordVal *RV = (CurRec ? CurRec->getValue(*(yyvsp[(1) - (1)].StrVal)) : 0)) {
+    (yyval.Initializer) = new VarInit(*(yyvsp[(1) - (1)].StrVal), RV->getType());
+  } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal))) {
+    const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal));
+    assert(RV && "Template arg doesn't exist??");
+    (yyval.Initializer) = new VarInit(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal), RV->getType());
+  } else if (CurMultiClass &&
+      CurMultiClass->Rec.isTemplateArg(CurMultiClass->Rec.getName()+"::"+*(yyvsp[(1) - (1)].StrVal))) {
+    std::string Name = CurMultiClass->Rec.getName()+"::"+*(yyvsp[(1) - (1)].StrVal);
+    const RecordVal *RV = CurMultiClass->Rec.getValue(Name);
+    assert(RV && "Template arg doesn't exist??");
+    (yyval.Initializer) = new VarInit(Name, RV->getType());
+  } else if (Record *D = Records.getDef(*(yyvsp[(1) - (1)].StrVal))) {
+    (yyval.Initializer) = new DefInit(D);
+  } else {
+    err() << "Variable not defined: '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
+    exit(1);
+  }
+  
+  delete (yyvsp[(1) - (1)].StrVal);
+;}
+    break;
+
+  case 16:
+#line 313 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = (yyvsp[(1) - (1)].Initializer);
+  ;}
+    break;
+
+  case 17:
+#line 315 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = new IntInit((yyvsp[(1) - (1)].IntVal));
+  ;}
+    break;
+
+  case 18:
+#line 317 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = new StringInit(*(yyvsp[(1) - (1)].StrVal));
+    delete (yyvsp[(1) - (1)].StrVal);
+  ;}
+    break;
+
+  case 19:
+#line 320 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = new CodeInit(*(yyvsp[(1) - (1)].StrVal));
+    delete (yyvsp[(1) - (1)].StrVal);
+  ;}
+    break;
+
+  case 20:
+#line 323 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = new UnsetInit();
+  ;}
+    break;
+
+  case 21:
+#line 325 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    BitsInit *Init = new BitsInit((yyvsp[(2) - (3)].FieldList)->size());
+    for (unsigned i = 0, e = (yyvsp[(2) - (3)].FieldList)->size(); i != e; ++i) {
+      struct Init *Bit = (*(yyvsp[(2) - (3)].FieldList))[i]->convertInitializerTo(new BitRecTy());
+      if (Bit == 0) {
+        err() << "Element #" << i << " (" << *(*(yyvsp[(2) - (3)].FieldList))[i]
+       	      << ") is not convertable to a bit!\n";
+        exit(1);
+      }
+      Init->setBit((yyvsp[(2) - (3)].FieldList)->size()-i-1, Bit);
+    }
+    (yyval.Initializer) = Init;
+    delete (yyvsp[(2) - (3)].FieldList);
+  ;}
+    break;
+
+  case 22:
+#line 338 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    // This is a CLASS<initvalslist> expression.  This is supposed to synthesize
+    // a new anonymous definition, deriving from CLASS<initvalslist> with no
+    // body.
+    Record *Class = Records.getClass(*(yyvsp[(1) - (4)].StrVal));
+    if (!Class) {
+      err() << "Expected a class, got '" << *(yyvsp[(1) - (4)].StrVal) << "'!\n";
+      exit(1);
+    }
+    delete (yyvsp[(1) - (4)].StrVal);
+    
+    static unsigned AnonCounter = 0;
+    Record *OldRec = CurRec;  // Save CurRec.
+    
+    // Create the new record, set it as CurRec temporarily.
+    CurRec = new Record("anonymous.val."+utostr(AnonCounter++));
+    addSubClass(Class, *(yyvsp[(3) - (4)].FieldList));    // Add info about the subclass to CurRec.
+    delete (yyvsp[(3) - (4)].FieldList);  // Free up the template args.
+    
+    CurRec->resolveReferences();
+    
+    Records.addDef(CurRec);
+    
+    // The result of the expression is a reference to the new record.
+    (yyval.Initializer) = new DefInit(CurRec);
+    
+    // Restore the old CurRec
+    CurRec = OldRec;
+  ;}
+    break;
+
+  case 23:
+#line 366 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = (yyvsp[(1) - (4)].Initializer)->convertInitializerBitRange(*(yyvsp[(3) - (4)].BitList));
+    if ((yyval.Initializer) == 0) {
+      err() << "Invalid bit range for value '" << *(yyvsp[(1) - (4)].Initializer) << "'!\n";
+      exit(1);
+    }
+    delete (yyvsp[(3) - (4)].BitList);
+  ;}
+    break;
+
+  case 24:
+#line 373 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = new ListInit(*(yyvsp[(2) - (3)].FieldList));
+    delete (yyvsp[(2) - (3)].FieldList);
+  ;}
+    break;
+
+  case 25:
+#line 376 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    if (!(yyvsp[(1) - (3)].Initializer)->getFieldType(*(yyvsp[(3) - (3)].StrVal))) {
+      err() << "Cannot access field '" << *(yyvsp[(3) - (3)].StrVal) << "' of value '" << *(yyvsp[(1) - (3)].Initializer) << "!\n";
+      exit(1);
+    }
+    (yyval.Initializer) = new FieldInit((yyvsp[(1) - (3)].Initializer), *(yyvsp[(3) - (3)].StrVal));
+    delete (yyvsp[(3) - (3)].StrVal);
+  ;}
+    break;
+
+  case 26:
+#line 383 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = new DagInit((yyvsp[(2) - (4)].Initializer), *(yyvsp[(3) - (4)].DagValueList));
+    delete (yyvsp[(3) - (4)].DagValueList);
+  ;}
+    break;
+
+  case 27:
+#line 386 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    std::reverse((yyvsp[(3) - (4)].BitList)->begin(), (yyvsp[(3) - (4)].BitList)->end());
+    (yyval.Initializer) = (yyvsp[(1) - (4)].Initializer)->convertInitListSlice(*(yyvsp[(3) - (4)].BitList));
+    if ((yyval.Initializer) == 0) {
+      err() << "Invalid list slice for value '" << *(yyvsp[(1) - (4)].Initializer) << "'!\n";
+      exit(1);
+    }
+    delete (yyvsp[(3) - (4)].BitList);
+  ;}
+    break;
+
+  case 28:
+#line 394 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = (new BinOpInit(BinOpInit::SHL, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
+  ;}
+    break;
+
+  case 29:
+#line 396 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = (new BinOpInit(BinOpInit::SRA, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
+  ;}
+    break;
+
+  case 30:
+#line 398 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = (new BinOpInit(BinOpInit::SRL, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
+  ;}
+    break;
+
+  case 31:
+#line 400 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.Initializer) = (new BinOpInit(BinOpInit::STRCONCAT, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
+  ;}
+    break;
+
+  case 32:
+#line 404 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.StrVal) = new std::string();
+  ;}
+    break;
+
+  case 33:
+#line 407 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
+  ;}
+    break;
+
+  case 34:
+#line 411 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.DagValueList) = new std::vector<std::pair<Init*, std::string> >();
+    (yyval.DagValueList)->push_back(std::make_pair((yyvsp[(1) - (2)].Initializer), *(yyvsp[(2) - (2)].StrVal)));
+    delete (yyvsp[(2) - (2)].StrVal);
+  ;}
+    break;
+
+  case 35:
+#line 416 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyvsp[(1) - (4)].DagValueList)->push_back(std::make_pair((yyvsp[(3) - (4)].Initializer), *(yyvsp[(4) - (4)].StrVal)));
+    delete (yyvsp[(4) - (4)].StrVal);
+    (yyval.DagValueList) = (yyvsp[(1) - (4)].DagValueList);
+  ;}
+    break;
+
+  case 36:
+#line 422 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.DagValueList) = new std::vector<std::pair<Init*, std::string> >();
+  ;}
+    break;
+
+  case 37:
+#line 425 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.DagValueList) = (yyvsp[(1) - (1)].DagValueList); ;}
+    break;
+
+  case 38:
+#line 428 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.BitList) = new std::vector<unsigned>();
+    (yyval.BitList)->push_back((yyvsp[(1) - (1)].IntVal));
+  ;}
+    break;
+
+  case 39:
+#line 431 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    if ((yyvsp[(1) - (3)].IntVal) < 0 || (yyvsp[(3) - (3)].IntVal) < 0) {
+      err() << "Invalid range: " << (yyvsp[(1) - (3)].IntVal) << "-" << (yyvsp[(3) - (3)].IntVal) << "!\n";
+      exit(1);
+    }
+    (yyval.BitList) = new std::vector<unsigned>();
+    if ((yyvsp[(1) - (3)].IntVal) < (yyvsp[(3) - (3)].IntVal)) {
+      for (int i = (yyvsp[(1) - (3)].IntVal); i <= (yyvsp[(3) - (3)].IntVal); ++i)
+        (yyval.BitList)->push_back(i);
+    } else {
+      for (int i = (yyvsp[(1) - (3)].IntVal); i >= (yyvsp[(3) - (3)].IntVal); --i)
+        (yyval.BitList)->push_back(i);
+    }
+  ;}
+    break;
+
+  case 40:
+#line 444 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyvsp[(2) - (2)].IntVal) = -(yyvsp[(2) - (2)].IntVal);
+    if ((yyvsp[(1) - (2)].IntVal) < 0 || (yyvsp[(2) - (2)].IntVal) < 0) {
+      err() << "Invalid range: " << (yyvsp[(1) - (2)].IntVal) << "-" << (yyvsp[(2) - (2)].IntVal) << "!\n";
+      exit(1);
+    }
+    (yyval.BitList) = new std::vector<unsigned>();
+    if ((yyvsp[(1) - (2)].IntVal) < (yyvsp[(2) - (2)].IntVal)) {
+      for (int i = (yyvsp[(1) - (2)].IntVal); i <= (yyvsp[(2) - (2)].IntVal); ++i)
+        (yyval.BitList)->push_back(i);
+    } else {
+      for (int i = (yyvsp[(1) - (2)].IntVal); i >= (yyvsp[(2) - (2)].IntVal); --i)
+        (yyval.BitList)->push_back(i);
+    }
+  ;}
+    break;
+
+  case 41:
+#line 458 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    ((yyval.BitList)=(yyvsp[(1) - (3)].BitList))->push_back((yyvsp[(3) - (3)].IntVal));
+  ;}
+    break;
+
+  case 42:
+#line 460 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    if ((yyvsp[(3) - (5)].IntVal) < 0 || (yyvsp[(5) - (5)].IntVal) < 0) {
+      err() << "Invalid range: " << (yyvsp[(3) - (5)].IntVal) << "-" << (yyvsp[(5) - (5)].IntVal) << "!\n";
+      exit(1);
+    }
+    (yyval.BitList) = (yyvsp[(1) - (5)].BitList);
+    if ((yyvsp[(3) - (5)].IntVal) < (yyvsp[(5) - (5)].IntVal)) {
+      for (int i = (yyvsp[(3) - (5)].IntVal); i <= (yyvsp[(5) - (5)].IntVal); ++i)
+        (yyval.BitList)->push_back(i);
+    } else {
+      for (int i = (yyvsp[(3) - (5)].IntVal); i >= (yyvsp[(5) - (5)].IntVal); --i)
+        (yyval.BitList)->push_back(i);
+    }
+  ;}
+    break;
+
+  case 43:
+#line 473 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyvsp[(4) - (4)].IntVal) = -(yyvsp[(4) - (4)].IntVal);
+    if ((yyvsp[(3) - (4)].IntVal) < 0 || (yyvsp[(4) - (4)].IntVal) < 0) {
+      err() << "Invalid range: " << (yyvsp[(3) - (4)].IntVal) << "-" << (yyvsp[(4) - (4)].IntVal) << "!\n";
+      exit(1);
+    }
+    (yyval.BitList) = (yyvsp[(1) - (4)].BitList);
+    if ((yyvsp[(3) - (4)].IntVal) < (yyvsp[(4) - (4)].IntVal)) {
+      for (int i = (yyvsp[(3) - (4)].IntVal); i <= (yyvsp[(4) - (4)].IntVal); ++i)
+        (yyval.BitList)->push_back(i);
+    } else {
+      for (int i = (yyvsp[(3) - (4)].IntVal); i >= (yyvsp[(4) - (4)].IntVal); --i)
+        (yyval.BitList)->push_back(i);
+    }
+  ;}
+    break;
+
+  case 44:
+#line 489 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.BitList) = (yyvsp[(1) - (1)].BitList); std::reverse((yyvsp[(1) - (1)].BitList)->begin(), (yyvsp[(1) - (1)].BitList)->end()); ;}
+    break;
+
+  case 45:
+#line 491 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.BitList) = 0; ;}
+    break;
+
+  case 46:
+#line 491 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.BitList) = (yyvsp[(2) - (3)].BitList); ;}
+    break;
+
+  case 47:
+#line 495 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.FieldList) = new std::vector<Init*>();
+  ;}
+    break;
+
+  case 48:
+#line 497 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.FieldList) = (yyvsp[(1) - (1)].FieldList);
+  ;}
+    break;
+
+  case 49:
+#line 501 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.FieldList) = new std::vector<Init*>();
+    (yyval.FieldList)->push_back((yyvsp[(1) - (1)].Initializer));
+  ;}
+    break;
+
+  case 50:
+#line 504 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    ((yyval.FieldList) = (yyvsp[(1) - (3)].FieldList))->push_back((yyvsp[(3) - (3)].Initializer));
+  ;}
+    break;
+
+  case 51:
+#line 508 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  std::string DecName = *(yyvsp[(3) - (4)].StrVal);
+  if (ParsingTemplateArgs) {
+    if (CurRec) {
+      DecName = CurRec->getName() + ":" + DecName;
+    } else {
+      assert(CurMultiClass);
+    }
+    if (CurMultiClass)
+      DecName = CurMultiClass->Rec.getName() + "::" + DecName;
+  }
+
+  addValue(RecordVal(DecName, (yyvsp[(2) - (4)].Ty), (yyvsp[(1) - (4)].IntVal)));
+  setValue(DecName, 0, (yyvsp[(4) - (4)].Initializer));
+  (yyval.StrVal) = new std::string(DecName);
+;}
+    break;
+
+  case 52:
+#line 525 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  delete (yyvsp[(1) - (2)].StrVal);
+;}
+    break;
+
+  case 53:
+#line 527 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  setValue(*(yyvsp[(2) - (6)].StrVal), (yyvsp[(3) - (6)].BitList), (yyvsp[(5) - (6)].Initializer));
+  delete (yyvsp[(2) - (6)].StrVal);
+  delete (yyvsp[(3) - (6)].BitList);
+;}
+    break;
+
+  case 58:
+#line 536 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.SubClassRef) = new SubClassRefTy((yyvsp[(1) - (1)].Rec), new std::vector<Init*>());
+  ;}
+    break;
+
+  case 59:
+#line 538 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.SubClassRef) = new SubClassRefTy((yyvsp[(1) - (4)].Rec), (yyvsp[(3) - (4)].FieldList));
+  ;}
+    break;
+
+  case 60:
+#line 542 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.SubClassList) = new std::vector<SubClassRefTy>();
+    (yyval.SubClassList)->push_back(*(yyvsp[(1) - (1)].SubClassRef));
+    delete (yyvsp[(1) - (1)].SubClassRef);
+  ;}
+    break;
+
+  case 61:
+#line 547 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    ((yyval.SubClassList)=(yyvsp[(1) - (3)].SubClassList))->push_back(*(yyvsp[(3) - (3)].SubClassRef));
+    delete (yyvsp[(3) - (3)].SubClassRef);
+  ;}
+    break;
+
+  case 62:
+#line 552 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.SubClassList) = new std::vector<SubClassRefTy>();
+  ;}
+    break;
+
+  case 63:
+#line 555 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    (yyval.SubClassList) = (yyvsp[(2) - (2)].SubClassList);
+  ;}
+    break;
+
+  case 64:
+#line 559 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  getActiveRec()->addTemplateArg(*(yyvsp[(1) - (1)].StrVal));
+  delete (yyvsp[(1) - (1)].StrVal);
+;}
+    break;
+
+  case 65:
+#line 562 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  getActiveRec()->addTemplateArg(*(yyvsp[(3) - (3)].StrVal));
+  delete (yyvsp[(3) - (3)].StrVal);
+;}
+    break;
+
+  case 66:
+#line 567 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {;}
+    break;
+
+  case 69:
+#line 570 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
+    break;
+
+  case 70:
+#line 570 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { (yyval.StrVal) = new std::string(); ;}
+    break;
+
+  case 71:
+#line 572 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  static unsigned AnonCounter = 0;
+  if ((yyvsp[(1) - (1)].StrVal)->empty())
+    *(yyvsp[(1) - (1)].StrVal) = "anonymous."+utostr(AnonCounter++);
+  (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal);
+;}
+    break;
+
+  case 72:
+#line 579 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  // If a class of this name already exists, it must be a forward ref.
+  if ((CurRec = Records.getClass(*(yyvsp[(1) - (1)].StrVal)))) {
+    // If the body was previously defined, this is an error.
+    if (!CurRec->getValues().empty() ||
+        !CurRec->getSuperClasses().empty() ||
+        !CurRec->getTemplateArgs().empty()) {
+      err() << "Class '" << CurRec->getName() << "' already defined!\n";
+      exit(1);
+    }
+  } else {
+    // If this is the first reference to this class, create and add it.
+    CurRec = new Record(*(yyvsp[(1) - (1)].StrVal));
+    Records.addClass(CurRec);
+  }
+  delete (yyvsp[(1) - (1)].StrVal);
+;}
+    break;
+
+  case 73:
+#line 597 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  CurRec = new Record(*(yyvsp[(1) - (1)].StrVal));
+  delete (yyvsp[(1) - (1)].StrVal);
+  
+  if (!CurMultiClass) {
+    // Top-level def definition.
+    
+    // Ensure redefinition doesn't happen.
+    if (Records.getDef(CurRec->getName())) {
+      err() << "def '" << CurRec->getName() << "' already defined!\n";
+      exit(1);
+    }
+    Records.addDef(CurRec);
+  } else {
+    // Otherwise, a def inside a multiclass, add it to the multiclass.
+    for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size(); i != e; ++i)
+      if (CurMultiClass->DefPrototypes[i]->getName() == CurRec->getName()) {
+        err() << "def '" << CurRec->getName()
+              << "' already defined in this multiclass!\n";
+        exit(1);
+      }
+    CurMultiClass->DefPrototypes.push_back(CurRec);
+  }
+;}
+    break;
+
+  case 74:
+#line 622 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+           for (unsigned i = 0, e = (yyvsp[(1) - (1)].SubClassList)->size(); i != e; ++i) {
+             addSubClass((*(yyvsp[(1) - (1)].SubClassList))[i].first, *(*(yyvsp[(1) - (1)].SubClassList))[i].second);
+             // Delete the template arg values for the class
+             delete (*(yyvsp[(1) - (1)].SubClassList))[i].second;
+           }
+           delete (yyvsp[(1) - (1)].SubClassList);   // Delete the class list.
+  
+           // Process any variables on the let stack.
+           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);
+         ;}
+    break;
+
+  case 75:
+#line 636 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+           (yyval.Rec) = CurRec;
+           CurRec = 0;
+         ;}
+    break;
+
+  case 76:
+#line 641 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+                ParsingTemplateArgs = true;
+            ;}
+    break;
+
+  case 77:
+#line 643 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+                ParsingTemplateArgs = false;
+            ;}
+    break;
+
+  case 78:
+#line 645 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+        (yyval.Rec) = (yyvsp[(6) - (6)].Rec);
+     ;}
+    break;
+
+  case 79:
+#line 649 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  if (CurMultiClass == 0)  // Def's in multiclasses aren't really defs.
+    (yyvsp[(3) - (3)].Rec)->resolveReferences();
+
+  // If ObjectBody has template arguments, it's an error.
+  assert((yyvsp[(3) - (3)].Rec)->getTemplateArgs().empty() && "How'd this get template args?");
+  (yyval.Rec) = (yyvsp[(3) - (3)].Rec);
+;}
+    break;
+
+  case 80:
+#line 659 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  (yyval.Rec) = (yyvsp[(1) - (1)].Rec);
+  // Copy the template arguments for the multiclass into the def.
+  const std::vector<std::string> &TArgs = CurMultiClass->Rec.getTemplateArgs();
+  
+  for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
+    const RecordVal *RV = CurMultiClass->Rec.getValue(TArgs[i]);
+    assert(RV && "Template arg doesn't exist?");
+    (yyval.Rec)->addValue(*RV);
+  }
+;}
+    break;
+
+  case 81:
+#line 673 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  (yyval.RecList) = new std::vector<Record*>();
+  (yyval.RecList)->push_back((yyvsp[(1) - (1)].Rec));
+;}
+    break;
+
+  case 82:
+#line 676 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  (yyval.RecList)->push_back((yyvsp[(2) - (2)].Rec));  
+;}
+    break;
+
+  case 83:
+#line 680 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  MultiClass *&MCE = MultiClasses[*(yyvsp[(1) - (1)].StrVal)];
+  if (MCE) {
+    err() << "multiclass '" << *(yyvsp[(1) - (1)].StrVal) << "' already defined!\n";
+    exit(1);
+  }
+  MCE = CurMultiClass = new MultiClass(*(yyvsp[(1) - (1)].StrVal));
+  delete (yyvsp[(1) - (1)].StrVal);
+;}
+    break;
+
+  case 84:
+#line 691 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+                                             ParsingTemplateArgs = true;
+                                           ;}
+    break;
+
+  case 85:
+#line 693 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+                                             ParsingTemplateArgs = false;
+                                           ;}
+    break;
+
+  case 86:
+#line 695 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  CurMultiClass = 0;
+;}
+    break;
+
+  case 87:
+#line 700 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { CurDefmPrefix = (yyvsp[(2) - (2)].StrVal); ;}
+    break;
+
+  case 88:
+#line 700 "/Volumes/Gir/devel/llvm/llvm.src/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
+  // template parameters.
+  MultiClass *MC = MultiClasses[(yyvsp[(5) - (6)].SubClassRef)->first->getName()];
+  assert(MC && "Didn't lookup multiclass correctly?");
+  std::vector<Init*> &TemplateVals = *(yyvsp[(5) - (6)].SubClassRef)->second;
+  delete (yyvsp[(5) - (6)].SubClassRef);
+  
+  // Verify that the correct number of template arguments were specified.
+  const std::vector<std::string> &TArgs = MC->Rec.getTemplateArgs();
+  if (TArgs.size() < TemplateVals.size()) {
+    err() << "ERROR: More template args specified than multiclass expects!\n";
+    exit(1);
+  }
+  
+  // Loop over all the def's in the multiclass, instantiating each one.
+  for (unsigned i = 0, e = MC->DefPrototypes.size(); i != e; ++i) {
+    Record *DefProto = MC->DefPrototypes[i];
+    
+    // Add the suffix to the defm name to get the new name.
+    assert(CurRec == 0 && "A def is current?");
+    CurRec = new Record(*(yyvsp[(2) - (6)].StrVal) + DefProto->getName());
+    
+    addSubClass(DefProto, std::vector<Init*>());
+    
+    // Loop over all of the template arguments, setting them to the specified
+    // value or leaving them as the default if necessary.
+    for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
+      if (i < TemplateVals.size()) { // A value is specified for this temp-arg?
+        // Set it now.
+        setValue(TArgs[i], 0, TemplateVals[i]);
+        
+        // Resolve it next.
+        CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i]));
+        
+        // Now remove it.
+        CurRec->removeValue(TArgs[i]);
+        
+      } else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
+        err() << "ERROR: Value not specified for template argument #"
+        << i << " (" << TArgs[i] << ") of multiclassclass '"
+        << MC->Rec.getName() << "'!\n";
+        exit(1);
+      }
+    }
+    
+    // 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.
+    if (Records.getDef(CurRec->getName())) {
+      err() << "def '" << CurRec->getName() << "' already defined, "
+            << "instantiating defm '" << *(yyvsp[(2) - (6)].StrVal) << "' with subdef '"
+            << DefProto->getName() << "'!\n";
+      exit(1);
+    }
+    Records.addDef(CurRec);
+    
+    CurRec->resolveReferences();
+
+    CurRec = 0;
+  }
+  
+  delete &TemplateVals;
+  delete (yyvsp[(2) - (6)].StrVal);
+  CurDefmPrefix = 0;
+;}
+    break;
+
+  case 89:
+#line 774 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {;}
+    break;
+
+  case 90:
+#line 774 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {;}
+    break;
+
+  case 93:
+#line 777 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+  LetStack.back().push_back(LetRecord(*(yyvsp[(1) - (4)].StrVal), (yyvsp[(2) - (4)].BitList), (yyvsp[(4) - (4)].Initializer)));
+  delete (yyvsp[(1) - (4)].StrVal); delete (yyvsp[(2) - (4)].BitList);
+;}
+    break;
+
+  case 96:
+#line 785 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    { LetStack.push_back(std::vector<LetRecord>()); ;}
+    break;
+
+  case 98:
+#line 788 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    LetStack.pop_back();
+  ;}
+    break;
+
+  case 99:
+#line 791 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {
+    LetStack.pop_back();
+  ;}
+    break;
+
+  case 100:
+#line 795 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {;}
+    break;
+
+  case 101:
+#line 795 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+    {;}
+    break;
+
+
+/* Line 1267 of yacc.c.  */
+#line 2643 "FileParser.tab.c"
+      default: break;
+    }
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
+	      }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#endif
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse look-ahead token after an
+	 error, discard it.  */
+
+      if (yychar <= YYEOF)
+	{
+	  /* Return failure if at end of input.  */
+	  if (yychar == YYEOF)
+	    YYABORT;
+	}
+      else
+	{
+	  yydestruct ("Error: discarding",
+		      yytoken, &yylval);
+	  yychar = YYEMPTY;
+	}
+    }
+
+  /* Else will try to reuse look-ahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR.  |
+`---------------------------------------------------*/
+yyerrorlab:
+
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (/*CONSTCOND*/ 0)
+     goto yyerrorlab;
+
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+  yystate = *yyssp;
+  goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR.  |
+`-------------------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+
+      yydestruct ("Error: popping",
+		  yystos[yystate], yyvsp);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  *++yyvsp = yylval;
+
+
+  /* Shift the error token.  */
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEOF && yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+		  yystos[*yyssp], yyvsp);
+      YYPOPSTACK (1);
+    }
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
+}
+
+
+#line 799 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
+
+
+int yyerror(const char *ErrorMsg) {
+  err() << "Error parsing: " << ErrorMsg << "\n";
+  exit(1);
+}
+
