It is pointless to turn a UINT_TO_FP into an
[oota-llvm.git] / lib / AsmParser / llvmAsmParser.cpp.cvs
1 /* A Bison parser, made by GNU Bison 2.3.  */
2
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4
5    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6    Free Software Foundation, Inc.
7
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2, or (at your option)
11    any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor,
21    Boston, MA 02110-1301, USA.  */
22
23 /* As a special exception, you may create a larger work that contains
24    part or all of the Bison parser skeleton and distribute that work
25    under terms of your choice, so long as that work isn't itself a
26    parser generator using the skeleton or a modified version thereof
27    as a parser skeleton.  Alternatively, if you modify or redistribute
28    the parser skeleton itself, you may (at your option) remove this
29    special exception, which will cause the skeleton and the resulting
30    Bison output files to be licensed under the GNU General Public
31    License without this special exception.
32
33    This special exception was added by the Free Software Foundation in
34    version 2.2 of Bison.  */
35
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37    simplifying the original so-called "semantic" parser.  */
38
39 /* All symbols defined below should begin with yy or YY, to avoid
40    infringing on user name space.  This should be done even for local
41    variables, as they might otherwise be expanded by user macros.
42    There are some unavoidable exceptions within include files to
43    define necessary library symbols; they are noted "INFRINGES ON
44    USER NAME SPACE" below.  */
45
46 /* Identify Bison output.  */
47 #define YYBISON 1
48
49 /* Bison version.  */
50 #define YYBISON_VERSION "2.3"
51
52 /* Skeleton name.  */
53 #define YYSKELETON_NAME "yacc.c"
54
55 /* Pure parsers.  */
56 #define YYPURE 0
57
58 /* Using locations.  */
59 #define YYLSP_NEEDED 0
60
61 /* Substitute the variable and function names.  */
62 #define yyparse llvmAsmparse
63 #define yylex   llvmAsmlex
64 #define yyerror llvmAsmerror
65 #define yylval  llvmAsmlval
66 #define yychar  llvmAsmchar
67 #define yydebug llvmAsmdebug
68 #define yynerrs llvmAsmnerrs
69
70
71 /* Tokens.  */
72 #ifndef YYTOKENTYPE
73 # define YYTOKENTYPE
74    /* Put the tokens into the symbol table, so that GDB and other debuggers
75       know about them.  */
76    enum yytokentype {
77      ESINT64VAL = 258,
78      EUINT64VAL = 259,
79      ESAPINTVAL = 260,
80      EUAPINTVAL = 261,
81      LOCALVAL_ID = 262,
82      GLOBALVAL_ID = 263,
83      FPVAL = 264,
84      VOID = 265,
85      INTTYPE = 266,
86      FLOAT = 267,
87      DOUBLE = 268,
88      X86_FP80 = 269,
89      FP128 = 270,
90      PPC_FP128 = 271,
91      LABEL = 272,
92      TYPE = 273,
93      LOCALVAR = 274,
94      GLOBALVAR = 275,
95      LABELSTR = 276,
96      STRINGCONSTANT = 277,
97      ATSTRINGCONSTANT = 278,
98      PCTSTRINGCONSTANT = 279,
99      ZEROINITIALIZER = 280,
100      TRUETOK = 281,
101      FALSETOK = 282,
102      BEGINTOK = 283,
103      ENDTOK = 284,
104      DECLARE = 285,
105      DEFINE = 286,
106      GLOBAL = 287,
107      CONSTANT = 288,
108      SECTION = 289,
109      ALIAS = 290,
110      VOLATILE = 291,
111      THREAD_LOCAL = 292,
112      TO = 293,
113      DOTDOTDOT = 294,
114      NULL_TOK = 295,
115      UNDEF = 296,
116      INTERNAL = 297,
117      LINKONCE = 298,
118      WEAK = 299,
119      APPENDING = 300,
120      DLLIMPORT = 301,
121      DLLEXPORT = 302,
122      EXTERN_WEAK = 303,
123      COMMON = 304,
124      OPAQUE = 305,
125      EXTERNAL = 306,
126      TARGET = 307,
127      TRIPLE = 308,
128      ALIGN = 309,
129      ADDRSPACE = 310,
130      DEPLIBS = 311,
131      CALL = 312,
132      TAIL = 313,
133      ASM_TOK = 314,
134      MODULE = 315,
135      SIDEEFFECT = 316,
136      CC_TOK = 317,
137      CCC_TOK = 318,
138      FASTCC_TOK = 319,
139      COLDCC_TOK = 320,
140      X86_STDCALLCC_TOK = 321,
141      X86_FASTCALLCC_TOK = 322,
142      DATALAYOUT = 323,
143      RET = 324,
144      BR = 325,
145      SWITCH = 326,
146      INVOKE = 327,
147      UNWIND = 328,
148      UNREACHABLE = 329,
149      ADD = 330,
150      SUB = 331,
151      MUL = 332,
152      UDIV = 333,
153      SDIV = 334,
154      FDIV = 335,
155      UREM = 336,
156      SREM = 337,
157      FREM = 338,
158      AND = 339,
159      OR = 340,
160      XOR = 341,
161      SHL = 342,
162      LSHR = 343,
163      ASHR = 344,
164      ICMP = 345,
165      FCMP = 346,
166      VICMP = 347,
167      VFCMP = 348,
168      EQ = 349,
169      NE = 350,
170      SLT = 351,
171      SGT = 352,
172      SLE = 353,
173      SGE = 354,
174      ULT = 355,
175      UGT = 356,
176      ULE = 357,
177      UGE = 358,
178      OEQ = 359,
179      ONE = 360,
180      OLT = 361,
181      OGT = 362,
182      OLE = 363,
183      OGE = 364,
184      ORD = 365,
185      UNO = 366,
186      UEQ = 367,
187      UNE = 368,
188      MALLOC = 369,
189      ALLOCA = 370,
190      FREE = 371,
191      LOAD = 372,
192      STORE = 373,
193      GETELEMENTPTR = 374,
194      TRUNC = 375,
195      ZEXT = 376,
196      SEXT = 377,
197      FPTRUNC = 378,
198      FPEXT = 379,
199      BITCAST = 380,
200      UITOFP = 381,
201      SITOFP = 382,
202      FPTOUI = 383,
203      FPTOSI = 384,
204      INTTOPTR = 385,
205      PTRTOINT = 386,
206      PHI_TOK = 387,
207      SELECT = 388,
208      VAARG = 389,
209      EXTRACTELEMENT = 390,
210      INSERTELEMENT = 391,
211      SHUFFLEVECTOR = 392,
212      GETRESULT = 393,
213      EXTRACTVALUE = 394,
214      INSERTVALUE = 395,
215      SIGNEXT = 396,
216      ZEROEXT = 397,
217      NORETURN = 398,
218      INREG = 399,
219      SRET = 400,
220      NOUNWIND = 401,
221      NOALIAS = 402,
222      BYVAL = 403,
223      NEST = 404,
224      READNONE = 405,
225      READONLY = 406,
226      GC = 407,
227      DEFAULT = 408,
228      HIDDEN = 409,
229      PROTECTED = 410
230    };
231 #endif
232 /* Tokens.  */
233 #define ESINT64VAL 258
234 #define EUINT64VAL 259
235 #define ESAPINTVAL 260
236 #define EUAPINTVAL 261
237 #define LOCALVAL_ID 262
238 #define GLOBALVAL_ID 263
239 #define FPVAL 264
240 #define VOID 265
241 #define INTTYPE 266
242 #define FLOAT 267
243 #define DOUBLE 268
244 #define X86_FP80 269
245 #define FP128 270
246 #define PPC_FP128 271
247 #define LABEL 272
248 #define TYPE 273
249 #define LOCALVAR 274
250 #define GLOBALVAR 275
251 #define LABELSTR 276
252 #define STRINGCONSTANT 277
253 #define ATSTRINGCONSTANT 278
254 #define PCTSTRINGCONSTANT 279
255 #define ZEROINITIALIZER 280
256 #define TRUETOK 281
257 #define FALSETOK 282
258 #define BEGINTOK 283
259 #define ENDTOK 284
260 #define DECLARE 285
261 #define DEFINE 286
262 #define GLOBAL 287
263 #define CONSTANT 288
264 #define SECTION 289
265 #define ALIAS 290
266 #define VOLATILE 291
267 #define THREAD_LOCAL 292
268 #define TO 293
269 #define DOTDOTDOT 294
270 #define NULL_TOK 295
271 #define UNDEF 296
272 #define INTERNAL 297
273 #define LINKONCE 298
274 #define WEAK 299
275 #define APPENDING 300
276 #define DLLIMPORT 301
277 #define DLLEXPORT 302
278 #define EXTERN_WEAK 303
279 #define COMMON 304
280 #define OPAQUE 305
281 #define EXTERNAL 306
282 #define TARGET 307
283 #define TRIPLE 308
284 #define ALIGN 309
285 #define ADDRSPACE 310
286 #define DEPLIBS 311
287 #define CALL 312
288 #define TAIL 313
289 #define ASM_TOK 314
290 #define MODULE 315
291 #define SIDEEFFECT 316
292 #define CC_TOK 317
293 #define CCC_TOK 318
294 #define FASTCC_TOK 319
295 #define COLDCC_TOK 320
296 #define X86_STDCALLCC_TOK 321
297 #define X86_FASTCALLCC_TOK 322
298 #define DATALAYOUT 323
299 #define RET 324
300 #define BR 325
301 #define SWITCH 326
302 #define INVOKE 327
303 #define UNWIND 328
304 #define UNREACHABLE 329
305 #define ADD 330
306 #define SUB 331
307 #define MUL 332
308 #define UDIV 333
309 #define SDIV 334
310 #define FDIV 335
311 #define UREM 336
312 #define SREM 337
313 #define FREM 338
314 #define AND 339
315 #define OR 340
316 #define XOR 341
317 #define SHL 342
318 #define LSHR 343
319 #define ASHR 344
320 #define ICMP 345
321 #define FCMP 346
322 #define VICMP 347
323 #define VFCMP 348
324 #define EQ 349
325 #define NE 350
326 #define SLT 351
327 #define SGT 352
328 #define SLE 353
329 #define SGE 354
330 #define ULT 355
331 #define UGT 356
332 #define ULE 357
333 #define UGE 358
334 #define OEQ 359
335 #define ONE 360
336 #define OLT 361
337 #define OGT 362
338 #define OLE 363
339 #define OGE 364
340 #define ORD 365
341 #define UNO 366
342 #define UEQ 367
343 #define UNE 368
344 #define MALLOC 369
345 #define ALLOCA 370
346 #define FREE 371
347 #define LOAD 372
348 #define STORE 373
349 #define GETELEMENTPTR 374
350 #define TRUNC 375
351 #define ZEXT 376
352 #define SEXT 377
353 #define FPTRUNC 378
354 #define FPEXT 379
355 #define BITCAST 380
356 #define UITOFP 381
357 #define SITOFP 382
358 #define FPTOUI 383
359 #define FPTOSI 384
360 #define INTTOPTR 385
361 #define PTRTOINT 386
362 #define PHI_TOK 387
363 #define SELECT 388
364 #define VAARG 389
365 #define EXTRACTELEMENT 390
366 #define INSERTELEMENT 391
367 #define SHUFFLEVECTOR 392
368 #define GETRESULT 393
369 #define EXTRACTVALUE 394
370 #define INSERTVALUE 395
371 #define SIGNEXT 396
372 #define ZEROEXT 397
373 #define NORETURN 398
374 #define INREG 399
375 #define SRET 400
376 #define NOUNWIND 401
377 #define NOALIAS 402
378 #define BYVAL 403
379 #define NEST 404
380 #define READNONE 405
381 #define READONLY 406
382 #define GC 407
383 #define DEFAULT 408
384 #define HIDDEN 409
385 #define PROTECTED 410
386
387
388
389
390 /* Copy the first part of user declarations.  */
391 #line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
392
393 #include "ParserInternals.h"
394 #include "llvm/CallingConv.h"
395 #include "llvm/InlineAsm.h"
396 #include "llvm/Instructions.h"
397 #include "llvm/Module.h"
398 #include "llvm/ValueSymbolTable.h"
399 #include "llvm/AutoUpgrade.h"
400 #include "llvm/Support/GetElementPtrTypeIterator.h"
401 #include "llvm/Support/CommandLine.h"
402 #include "llvm/ADT/SmallVector.h"
403 #include "llvm/ADT/STLExtras.h"
404 #include "llvm/Support/MathExtras.h"
405 #include "llvm/Support/Streams.h"
406 #include <algorithm>
407 #include <list>
408 #include <map>
409 #include <utility>
410
411 // The following is a gross hack. In order to rid the libAsmParser library of
412 // exceptions, we have to have a way of getting the yyparse function to go into
413 // an error situation. So, whenever we want an error to occur, the GenerateError
414 // function (see bottom of file) sets TriggerError. Then, at the end of each 
415 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR 
416 // (a goto) to put YACC in error state. Furthermore, several calls to 
417 // GenerateError are made from inside productions and they must simulate the
418 // previous exception behavior by exiting the production immediately. We have
419 // replaced these with the GEN_ERROR macro which calls GeneratError and then
420 // immediately invokes YYERROR. This would be so much cleaner if it was a 
421 // recursive descent parser.
422 static bool TriggerError = false;
423 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
424 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
425
426 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
427 int yylex();                       // declaration" of xxx warnings.
428 int yyparse();
429 using namespace llvm;
430
431 static Module *ParserResult;
432
433 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
434 // relating to upreferences in the input stream.
435 //
436 //#define DEBUG_UPREFS 1
437 #ifdef DEBUG_UPREFS
438 #define UR_OUT(X) cerr << X
439 #else
440 #define UR_OUT(X)
441 #endif
442
443 #define YYERROR_VERBOSE 1
444
445 static GlobalVariable *CurGV;
446
447
448 // This contains info used when building the body of a function.  It is
449 // destroyed when the function is completed.
450 //
451 typedef std::vector<Value *> ValueList;           // Numbered defs
452
453 static void 
454 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
455
456 static struct PerModuleInfo {
457   Module *CurrentModule;
458   ValueList Values; // Module level numbered definitions
459   ValueList LateResolveValues;
460   std::vector<PATypeHolder>    Types;
461   std::map<ValID, PATypeHolder> LateResolveTypes;
462
463   /// PlaceHolderInfo - When temporary placeholder objects are created, remember
464   /// how they were referenced and on which line of the input they came from so
465   /// that we can resolve them later and print error messages as appropriate.
466   std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
467
468   // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
469   // references to global values.  Global values may be referenced before they
470   // are defined, and if so, the temporary object that they represent is held
471   // here.  This is used for forward references of GlobalValues.
472   //
473   typedef std::map<std::pair<const PointerType *,
474                              ValID>, GlobalValue*> GlobalRefsType;
475   GlobalRefsType GlobalRefs;
476
477   void ModuleDone() {
478     // If we could not resolve some functions at function compilation time
479     // (calls to functions before they are defined), resolve them now...  Types
480     // are resolved when the constant pool has been completely parsed.
481     //
482     ResolveDefinitions(LateResolveValues);
483     if (TriggerError)
484       return;
485
486     // Check to make sure that all global value forward references have been
487     // resolved!
488     //
489     if (!GlobalRefs.empty()) {
490       std::string UndefinedReferences = "Unresolved global references exist:\n";
491
492       for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
493            I != E; ++I) {
494         UndefinedReferences += "  " + I->first.first->getDescription() + " " +
495                                I->first.second.getName() + "\n";
496       }
497       GenerateError(UndefinedReferences);
498       return;
499     }
500
501     // Look for intrinsic functions and CallInst that need to be upgraded
502     for (Module::iterator FI = CurrentModule->begin(),
503          FE = CurrentModule->end(); FI != FE; )
504       UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
505
506     Values.clear();         // Clear out function local definitions
507     Types.clear();
508     CurrentModule = 0;
509   }
510
511   // GetForwardRefForGlobal - Check to see if there is a forward reference
512   // for this global.  If so, remove it from the GlobalRefs map and return it.
513   // If not, just return null.
514   GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
515     // Check to see if there is a forward reference to this global variable...
516     // if there is, eliminate it and patch the reference to use the new def'n.
517     GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
518     GlobalValue *Ret = 0;
519     if (I != GlobalRefs.end()) {
520       Ret = I->second;
521       GlobalRefs.erase(I);
522     }
523     return Ret;
524   }
525
526   bool TypeIsUnresolved(PATypeHolder* PATy) {
527     // If it isn't abstract, its resolved
528     const Type* Ty = PATy->get();
529     if (!Ty->isAbstract())
530       return false;
531     // Traverse the type looking for abstract types. If it isn't abstract then
532     // we don't need to traverse that leg of the type. 
533     std::vector<const Type*> WorkList, SeenList;
534     WorkList.push_back(Ty);
535     while (!WorkList.empty()) {
536       const Type* Ty = WorkList.back();
537       SeenList.push_back(Ty);
538       WorkList.pop_back();
539       if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
540         // Check to see if this is an unresolved type
541         std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
542         std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
543         for ( ; I != E; ++I) {
544           if (I->second.get() == OpTy)
545             return true;
546         }
547       } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
548         const Type* TheTy = SeqTy->getElementType();
549         if (TheTy->isAbstract() && TheTy != Ty) {
550           std::vector<const Type*>::iterator I = SeenList.begin(), 
551                                              E = SeenList.end();
552           for ( ; I != E; ++I)
553             if (*I == TheTy)
554               break;
555           if (I == E)
556             WorkList.push_back(TheTy);
557         }
558       } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
559         for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
560           const Type* TheTy = StrTy->getElementType(i);
561           if (TheTy->isAbstract() && TheTy != Ty) {
562             std::vector<const Type*>::iterator I = SeenList.begin(), 
563                                                E = SeenList.end();
564             for ( ; I != E; ++I)
565               if (*I == TheTy)
566                 break;
567             if (I == E)
568               WorkList.push_back(TheTy);
569           }
570         }
571       }
572     }
573     return false;
574   }
575 } CurModule;
576
577 static struct PerFunctionInfo {
578   Function *CurrentFunction;     // Pointer to current function being created
579
580   ValueList Values; // Keep track of #'d definitions
581   unsigned NextValNum;
582   ValueList LateResolveValues;
583   bool isDeclare;                   // Is this function a forward declararation?
584   GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
585   GlobalValue::VisibilityTypes Visibility;
586
587   /// BBForwardRefs - When we see forward references to basic blocks, keep
588   /// track of them here.
589   std::map<ValID, BasicBlock*> BBForwardRefs;
590
591   inline PerFunctionInfo() {
592     CurrentFunction = 0;
593     isDeclare = false;
594     Linkage = GlobalValue::ExternalLinkage;
595     Visibility = GlobalValue::DefaultVisibility;
596   }
597
598   inline void FunctionStart(Function *M) {
599     CurrentFunction = M;
600     NextValNum = 0;
601   }
602
603   void FunctionDone() {
604     // Any forward referenced blocks left?
605     if (!BBForwardRefs.empty()) {
606       GenerateError("Undefined reference to label " +
607                      BBForwardRefs.begin()->second->getName());
608       return;
609     }
610
611     // Resolve all forward references now.
612     ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
613
614     Values.clear();         // Clear out function local definitions
615     BBForwardRefs.clear();
616     CurrentFunction = 0;
617     isDeclare = false;
618     Linkage = GlobalValue::ExternalLinkage;
619     Visibility = GlobalValue::DefaultVisibility;
620   }
621 } CurFun;  // Info for the current function...
622
623 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
624
625
626 //===----------------------------------------------------------------------===//
627 //               Code to handle definitions of all the types
628 //===----------------------------------------------------------------------===//
629
630 static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
631   // Things that have names or are void typed don't get slot numbers
632   if (V->hasName() || (V->getType() == Type::VoidTy))
633     return;
634
635   // In the case of function values, we have to allow for the forward reference
636   // of basic blocks, which are included in the numbering. Consequently, we keep
637   // track of the next insertion location with NextValNum. When a BB gets 
638   // inserted, it could change the size of the CurFun.Values vector.
639   if (&ValueTab == &CurFun.Values) {
640     if (ValueTab.size() <= CurFun.NextValNum)
641       ValueTab.resize(CurFun.NextValNum+1);
642     ValueTab[CurFun.NextValNum++] = V;
643     return;
644   } 
645   // For all other lists, its okay to just tack it on the back of the vector.
646   ValueTab.push_back(V);
647 }
648
649 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
650   switch (D.Type) {
651   case ValID::LocalID:               // Is it a numbered definition?
652     // Module constants occupy the lowest numbered slots...
653     if (D.Num < CurModule.Types.size())
654       return CurModule.Types[D.Num];
655     break;
656   case ValID::LocalName:                 // Is it a named definition?
657     if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
658       D.destroy();  // Free old strdup'd memory...
659       return N;
660     }
661     break;
662   default:
663     GenerateError("Internal parser error: Invalid symbol type reference");
664     return 0;
665   }
666
667   // If we reached here, we referenced either a symbol that we don't know about
668   // or an id number that hasn't been read yet.  We may be referencing something
669   // forward, so just create an entry to be resolved later and get to it...
670   //
671   if (DoNotImprovise) return 0;  // Do we just want a null to be returned?
672
673
674   if (inFunctionScope()) {
675     if (D.Type == ValID::LocalName) {
676       GenerateError("Reference to an undefined type: '" + D.getName() + "'");
677       return 0;
678     } else {
679       GenerateError("Reference to an undefined type: #" + utostr(D.Num));
680       return 0;
681     }
682   }
683
684   std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
685   if (I != CurModule.LateResolveTypes.end())
686     return I->second;
687
688   Type *Typ = OpaqueType::get();
689   CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
690   return Typ;
691  }
692
693 // getExistingVal - Look up the value specified by the provided type and
694 // the provided ValID.  If the value exists and has already been defined, return
695 // it.  Otherwise return null.
696 //
697 static Value *getExistingVal(const Type *Ty, const ValID &D) {
698   if (isa<FunctionType>(Ty)) {
699     GenerateError("Functions are not values and "
700                    "must be referenced as pointers");
701     return 0;
702   }
703
704   switch (D.Type) {
705   case ValID::LocalID: {                 // Is it a numbered definition?
706     // Check that the number is within bounds.
707     if (D.Num >= CurFun.Values.size()) 
708       return 0;
709     Value *Result = CurFun.Values[D.Num];
710     if (Ty != Result->getType()) {
711       GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
712                     Result->getType()->getDescription() + "' does not match " 
713                     "expected type, '" + Ty->getDescription() + "'");
714       return 0;
715     }
716     return Result;
717   }
718   case ValID::GlobalID: {                 // Is it a numbered definition?
719     if (D.Num >= CurModule.Values.size()) 
720       return 0;
721     Value *Result = CurModule.Values[D.Num];
722     if (Ty != Result->getType()) {
723       GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
724                     Result->getType()->getDescription() + "' does not match " 
725                     "expected type, '" + Ty->getDescription() + "'");
726       return 0;
727     }
728     return Result;
729   }
730     
731   case ValID::LocalName: {                // Is it a named definition?
732     if (!inFunctionScope()) 
733       return 0;
734     ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
735     Value *N = SymTab.lookup(D.getName());
736     if (N == 0) 
737       return 0;
738     if (N->getType() != Ty)
739       return 0;
740     
741     D.destroy();  // Free old strdup'd memory...
742     return N;
743   }
744   case ValID::GlobalName: {                // Is it a named definition?
745     ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
746     Value *N = SymTab.lookup(D.getName());
747     if (N == 0) 
748       return 0;
749     if (N->getType() != Ty)
750       return 0;
751
752     D.destroy();  // Free old strdup'd memory...
753     return N;
754   }
755
756   // Check to make sure that "Ty" is an integral type, and that our
757   // value will fit into the specified type...
758   case ValID::ConstSIntVal:    // Is it a constant pool reference??
759     if (!isa<IntegerType>(Ty) ||
760         !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
761       GenerateError("Signed integral constant '" +
762                      itostr(D.ConstPool64) + "' is invalid for type '" +
763                      Ty->getDescription() + "'");
764       return 0;
765     }
766     return ConstantInt::get(Ty, D.ConstPool64, true);
767
768   case ValID::ConstUIntVal:     // Is it an unsigned const pool reference?
769     if (isa<IntegerType>(Ty) &&
770         ConstantInt::isValueValidForType(Ty, D.UConstPool64))
771       return ConstantInt::get(Ty, D.UConstPool64);
772
773     if (!isa<IntegerType>(Ty) ||
774         !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
775       GenerateError("Integral constant '" + utostr(D.UConstPool64) +
776                     "' is invalid or out of range for type '" +
777                     Ty->getDescription() + "'");
778       return 0;
779     }
780     // This is really a signed reference.  Transmogrify.
781     return ConstantInt::get(Ty, D.ConstPool64, true);
782
783   case ValID::ConstAPInt:     // Is it an unsigned const pool reference?
784     if (!isa<IntegerType>(Ty)) {
785       GenerateError("Integral constant '" + D.getName() +
786                     "' is invalid or out of range for type '" +
787                     Ty->getDescription() + "'");
788       return 0;
789     }
790       
791     {
792       APSInt Tmp = *D.ConstPoolInt;
793       Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
794       return ConstantInt::get(Tmp);
795     }
796       
797   case ValID::ConstFPVal:        // Is it a floating point const pool reference?
798     if (!Ty->isFloatingPoint() ||
799         !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
800       GenerateError("FP constant invalid for type");
801       return 0;
802     }
803     // Lexer has no type info, so builds all float and double FP constants 
804     // as double.  Fix this here.  Long double does not need this.
805     if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
806         Ty==Type::FloatTy)
807       D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
808     return ConstantFP::get(*D.ConstPoolFP);
809
810   case ValID::ConstNullVal:      // Is it a null value?
811     if (!isa<PointerType>(Ty)) {
812       GenerateError("Cannot create a a non pointer null");
813       return 0;
814     }
815     return ConstantPointerNull::get(cast<PointerType>(Ty));
816
817   case ValID::ConstUndefVal:      // Is it an undef value?
818     return UndefValue::get(Ty);
819
820   case ValID::ConstZeroVal:      // Is it a zero value?
821     return Constant::getNullValue(Ty);
822     
823   case ValID::ConstantVal:       // Fully resolved constant?
824     if (D.ConstantValue->getType() != Ty) {
825       GenerateError("Constant expression type different from required type");
826       return 0;
827     }
828     return D.ConstantValue;
829
830   case ValID::InlineAsmVal: {    // Inline asm expression
831     const PointerType *PTy = dyn_cast<PointerType>(Ty);
832     const FunctionType *FTy =
833       PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
834     if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
835       GenerateError("Invalid type for asm constraint string");
836       return 0;
837     }
838     InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
839                                    D.IAD->HasSideEffects);
840     D.destroy();   // Free InlineAsmDescriptor.
841     return IA;
842   }
843   default:
844     assert(0 && "Unhandled case!");
845     return 0;
846   }   // End of switch
847
848   assert(0 && "Unhandled case!");
849   return 0;
850 }
851
852 // getVal - This function is identical to getExistingVal, except that if a
853 // value is not already defined, it "improvises" by creating a placeholder var
854 // that looks and acts just like the requested variable.  When the value is
855 // defined later, all uses of the placeholder variable are replaced with the
856 // real thing.
857 //
858 static Value *getVal(const Type *Ty, const ValID &ID) {
859   if (Ty == Type::LabelTy) {
860     GenerateError("Cannot use a basic block here");
861     return 0;
862   }
863
864   // See if the value has already been defined.
865   Value *V = getExistingVal(Ty, ID);
866   if (V) return V;
867   if (TriggerError) return 0;
868
869   if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
870     GenerateError("Invalid use of a non-first-class type");
871     return 0;
872   }
873
874   // If we reached here, we referenced either a symbol that we don't know about
875   // or an id number that hasn't been read yet.  We may be referencing something
876   // forward, so just create an entry to be resolved later and get to it...
877   //
878   switch (ID.Type) {
879   case ValID::GlobalName:
880   case ValID::GlobalID: {
881    const PointerType *PTy = dyn_cast<PointerType>(Ty);
882    if (!PTy) {
883      GenerateError("Invalid type for reference to global" );
884      return 0;
885    }
886    const Type* ElTy = PTy->getElementType();
887    if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
888      V = Function::Create(FTy, GlobalValue::ExternalLinkage);
889    else
890      V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
891                             (Module*)0, false, PTy->getAddressSpace());
892    break;
893   }
894   default:
895    V = new Argument(Ty);
896   }
897   
898   // Remember where this forward reference came from.  FIXME, shouldn't we try
899   // to recycle these things??
900   CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
901                                                               LLLgetLineNo())));
902
903   if (inFunctionScope())
904     InsertValue(V, CurFun.LateResolveValues);
905   else
906     InsertValue(V, CurModule.LateResolveValues);
907   return V;
908 }
909
910 /// defineBBVal - This is a definition of a new basic block with the specified
911 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
912 static BasicBlock *defineBBVal(const ValID &ID) {
913   assert(inFunctionScope() && "Can't get basic block at global scope!");
914
915   BasicBlock *BB = 0;
916
917   // First, see if this was forward referenced
918
919   std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
920   if (BBI != CurFun.BBForwardRefs.end()) {
921     BB = BBI->second;
922     // The forward declaration could have been inserted anywhere in the
923     // function: insert it into the correct place now.
924     CurFun.CurrentFunction->getBasicBlockList().remove(BB);
925     CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
926
927     // We're about to erase the entry, save the key so we can clean it up.
928     ValID Tmp = BBI->first;
929
930     // Erase the forward ref from the map as its no longer "forward"
931     CurFun.BBForwardRefs.erase(ID);
932
933     // The key has been removed from the map but so we don't want to leave 
934     // strdup'd memory around so destroy it too.
935     Tmp.destroy();
936
937     // If its a numbered definition, bump the number and set the BB value.
938     if (ID.Type == ValID::LocalID) {
939       assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
940       InsertValue(BB);
941     }
942   } else { 
943     // We haven't seen this BB before and its first mention is a definition. 
944     // Just create it and return it.
945     std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
946     BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
947     if (ID.Type == ValID::LocalID) {
948       assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
949       InsertValue(BB);
950     }
951   }
952
953   ID.destroy();
954   return BB;
955 }
956
957 /// getBBVal - get an existing BB value or create a forward reference for it.
958 /// 
959 static BasicBlock *getBBVal(const ValID &ID) {
960   assert(inFunctionScope() && "Can't get basic block at global scope!");
961
962   BasicBlock *BB =  0;
963
964   std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
965   if (BBI != CurFun.BBForwardRefs.end()) {
966     BB = BBI->second;
967   } if (ID.Type == ValID::LocalName) {
968     std::string Name = ID.getName();
969     Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
970     if (N) {
971       if (N->getType()->getTypeID() == Type::LabelTyID)
972         BB = cast<BasicBlock>(N);
973       else
974         GenerateError("Reference to label '" + Name + "' is actually of type '"+
975           N->getType()->getDescription() + "'");
976     }
977   } else if (ID.Type == ValID::LocalID) {
978     if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
979       if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
980         BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
981       else
982         GenerateError("Reference to label '%" + utostr(ID.Num) + 
983           "' is actually of type '"+ 
984           CurFun.Values[ID.Num]->getType()->getDescription() + "'");
985     }
986   } else {
987     GenerateError("Illegal label reference " + ID.getName());
988     return 0;
989   }
990
991   // If its already been defined, return it now.
992   if (BB) {
993     ID.destroy(); // Free strdup'd memory.
994     return BB;
995   }
996
997   // Otherwise, this block has not been seen before, create it.
998   std::string Name;
999   if (ID.Type == ValID::LocalName)
1000     Name = ID.getName();
1001   BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1002
1003   // Insert it in the forward refs map.
1004   CurFun.BBForwardRefs[ID] = BB;
1005
1006   return BB;
1007 }
1008
1009
1010 //===----------------------------------------------------------------------===//
1011 //              Code to handle forward references in instructions
1012 //===----------------------------------------------------------------------===//
1013 //
1014 // This code handles the late binding needed with statements that reference
1015 // values not defined yet... for example, a forward branch, or the PHI node for
1016 // a loop body.
1017 //
1018 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1019 // and back patchs after we are done.
1020 //
1021
1022 // ResolveDefinitions - If we could not resolve some defs at parsing
1023 // time (forward branches, phi functions for loops, etc...) resolve the
1024 // defs now...
1025 //
1026 static void 
1027 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1028   // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1029   while (!LateResolvers.empty()) {
1030     Value *V = LateResolvers.back();
1031     LateResolvers.pop_back();
1032
1033     std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1034       CurModule.PlaceHolderInfo.find(V);
1035     assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1036
1037     ValID &DID = PHI->second.first;
1038
1039     Value *TheRealValue = getExistingVal(V->getType(), DID);
1040     if (TriggerError)
1041       return;
1042     if (TheRealValue) {
1043       V->replaceAllUsesWith(TheRealValue);
1044       delete V;
1045       CurModule.PlaceHolderInfo.erase(PHI);
1046     } else if (FutureLateResolvers) {
1047       // Functions have their unresolved items forwarded to the module late
1048       // resolver table
1049       InsertValue(V, *FutureLateResolvers);
1050     } else {
1051       if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1052         GenerateError("Reference to an invalid definition: '" +DID.getName()+
1053                        "' of type '" + V->getType()->getDescription() + "'",
1054                        PHI->second.second);
1055         return;
1056       } else {
1057         GenerateError("Reference to an invalid definition: #" +
1058                        itostr(DID.Num) + " of type '" +
1059                        V->getType()->getDescription() + "'",
1060                        PHI->second.second);
1061         return;
1062       }
1063     }
1064   }
1065   LateResolvers.clear();
1066 }
1067
1068 // ResolveTypeTo - A brand new type was just declared.  This means that (if
1069 // name is not null) things referencing Name can be resolved.  Otherwise, things
1070 // refering to the number can be resolved.  Do this now.
1071 //
1072 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1073   ValID D;
1074   if (Name)
1075     D = ValID::createLocalName(*Name);
1076   else      
1077     D = ValID::createLocalID(CurModule.Types.size());
1078
1079   std::map<ValID, PATypeHolder>::iterator I =
1080     CurModule.LateResolveTypes.find(D);
1081   if (I != CurModule.LateResolveTypes.end()) {
1082     ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1083     CurModule.LateResolveTypes.erase(I);
1084   }
1085 }
1086
1087 // setValueName - Set the specified value to the name given.  The name may be
1088 // null potentially, in which case this is a noop.  The string passed in is
1089 // assumed to be a malloc'd string buffer, and is free'd by this function.
1090 //
1091 static void setValueName(Value *V, std::string *NameStr) {
1092   if (!NameStr) return;
1093   std::string Name(*NameStr);      // Copy string
1094   delete NameStr;                  // Free old string
1095
1096   if (V->getType() == Type::VoidTy) {
1097     GenerateError("Can't assign name '" + Name+"' to value with void type");
1098     return;
1099   }
1100
1101   assert(inFunctionScope() && "Must be in function scope!");
1102   ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1103   if (ST.lookup(Name)) {
1104     GenerateError("Redefinition of value '" + Name + "' of type '" +
1105                    V->getType()->getDescription() + "'");
1106     return;
1107   }
1108
1109   // Set the name.
1110   V->setName(Name);
1111 }
1112
1113 /// ParseGlobalVariable - Handle parsing of a global.  If Initializer is null,
1114 /// this is a declaration, otherwise it is a definition.
1115 static GlobalVariable *
1116 ParseGlobalVariable(std::string *NameStr,
1117                     GlobalValue::LinkageTypes Linkage,
1118                     GlobalValue::VisibilityTypes Visibility,
1119                     bool isConstantGlobal, const Type *Ty,
1120                     Constant *Initializer, bool IsThreadLocal,
1121                     unsigned AddressSpace = 0) {
1122   if (isa<FunctionType>(Ty)) {
1123     GenerateError("Cannot declare global vars of function type");
1124     return 0;
1125   }
1126   if (Ty == Type::LabelTy) {
1127     GenerateError("Cannot declare global vars of label type");
1128     return 0;
1129   }
1130
1131   const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1132
1133   std::string Name;
1134   if (NameStr) {
1135     Name = *NameStr;      // Copy string
1136     delete NameStr;       // Free old string
1137   }
1138
1139   // See if this global value was forward referenced.  If so, recycle the
1140   // object.
1141   ValID ID;
1142   if (!Name.empty()) {
1143     ID = ValID::createGlobalName(Name);
1144   } else {
1145     ID = ValID::createGlobalID(CurModule.Values.size());
1146   }
1147
1148   if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1149     // Move the global to the end of the list, from whereever it was
1150     // previously inserted.
1151     GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1152     CurModule.CurrentModule->getGlobalList().remove(GV);
1153     CurModule.CurrentModule->getGlobalList().push_back(GV);
1154     GV->setInitializer(Initializer);
1155     GV->setLinkage(Linkage);
1156     GV->setVisibility(Visibility);
1157     GV->setConstant(isConstantGlobal);
1158     GV->setThreadLocal(IsThreadLocal);
1159     InsertValue(GV, CurModule.Values);
1160     return GV;
1161   }
1162
1163   // If this global has a name
1164   if (!Name.empty()) {
1165     // if the global we're parsing has an initializer (is a definition) and
1166     // has external linkage.
1167     if (Initializer && Linkage != GlobalValue::InternalLinkage)
1168       // If there is already a global with external linkage with this name
1169       if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1170         // If we allow this GVar to get created, it will be renamed in the
1171         // symbol table because it conflicts with an existing GVar. We can't
1172         // allow redefinition of GVars whose linking indicates that their name
1173         // must stay the same. Issue the error.
1174         GenerateError("Redefinition of global variable named '" + Name +
1175                        "' of type '" + Ty->getDescription() + "'");
1176         return 0;
1177       }
1178   }
1179
1180   // Otherwise there is no existing GV to use, create one now.
1181   GlobalVariable *GV =
1182     new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1183                        CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1184   GV->setVisibility(Visibility);
1185   InsertValue(GV, CurModule.Values);
1186   return GV;
1187 }
1188
1189 // setTypeName - Set the specified type to the name given.  The name may be
1190 // null potentially, in which case this is a noop.  The string passed in is
1191 // assumed to be a malloc'd string buffer, and is freed by this function.
1192 //
1193 // This function returns true if the type has already been defined, but is
1194 // allowed to be redefined in the specified context.  If the name is a new name
1195 // for the type plane, it is inserted and false is returned.
1196 static bool setTypeName(const Type *T, std::string *NameStr) {
1197   assert(!inFunctionScope() && "Can't give types function-local names!");
1198   if (NameStr == 0) return false;
1199  
1200   std::string Name(*NameStr);      // Copy string
1201   delete NameStr;                  // Free old string
1202
1203   // We don't allow assigning names to void type
1204   if (T == Type::VoidTy) {
1205     GenerateError("Can't assign name '" + Name + "' to the void type");
1206     return false;
1207   }
1208
1209   // Set the type name, checking for conflicts as we do so.
1210   bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1211
1212   if (AlreadyExists) {   // Inserting a name that is already defined???
1213     const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1214     assert(Existing && "Conflict but no matching type?!");
1215
1216     // There is only one case where this is allowed: when we are refining an
1217     // opaque type.  In this case, Existing will be an opaque type.
1218     if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1219       // We ARE replacing an opaque type!
1220       const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1221       return true;
1222     }
1223
1224     // Otherwise, this is an attempt to redefine a type. That's okay if
1225     // the redefinition is identical to the original. This will be so if
1226     // Existing and T point to the same Type object. In this one case we
1227     // allow the equivalent redefinition.
1228     if (Existing == T) return true;  // Yes, it's equal.
1229
1230     // Any other kind of (non-equivalent) redefinition is an error.
1231     GenerateError("Redefinition of type named '" + Name + "' of type '" +
1232                    T->getDescription() + "'");
1233   }
1234
1235   return false;
1236 }
1237
1238 //===----------------------------------------------------------------------===//
1239 // Code for handling upreferences in type names...
1240 //
1241
1242 // TypeContains - Returns true if Ty directly contains E in it.
1243 //
1244 static bool TypeContains(const Type *Ty, const Type *E) {
1245   return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1246                    E) != Ty->subtype_end();
1247 }
1248
1249 namespace {
1250   struct UpRefRecord {
1251     // NestingLevel - The number of nesting levels that need to be popped before
1252     // this type is resolved.
1253     unsigned NestingLevel;
1254
1255     // LastContainedTy - This is the type at the current binding level for the
1256     // type.  Every time we reduce the nesting level, this gets updated.
1257     const Type *LastContainedTy;
1258
1259     // UpRefTy - This is the actual opaque type that the upreference is
1260     // represented with.
1261     OpaqueType *UpRefTy;
1262
1263     UpRefRecord(unsigned NL, OpaqueType *URTy)
1264       : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1265   };
1266 }
1267
1268 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1269 static std::vector<UpRefRecord> UpRefs;
1270
1271 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1272 /// called.  It loops through the UpRefs vector, which is a list of the
1273 /// currently active types.  For each type, if the up reference is contained in
1274 /// the newly completed type, we decrement the level count.  When the level
1275 /// count reaches zero, the upreferenced type is the type that is passed in:
1276 /// thus we can complete the cycle.
1277 ///
1278 static PATypeHolder HandleUpRefs(const Type *ty) {
1279   // If Ty isn't abstract, or if there are no up-references in it, then there is
1280   // nothing to resolve here.
1281   if (!ty->isAbstract() || UpRefs.empty()) return ty;
1282   
1283   PATypeHolder Ty(ty);
1284   UR_OUT("Type '" << Ty->getDescription() <<
1285          "' newly formed.  Resolving upreferences.\n" <<
1286          UpRefs.size() << " upreferences active!\n");
1287
1288   // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1289   // to zero), we resolve them all together before we resolve them to Ty.  At
1290   // the end of the loop, if there is anything to resolve to Ty, it will be in
1291   // this variable.
1292   OpaqueType *TypeToResolve = 0;
1293
1294   for (unsigned i = 0; i != UpRefs.size(); ++i) {
1295     UR_OUT("  UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1296            << UpRefs[i].second->getDescription() << ") = "
1297            << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1298     if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1299       // Decrement level of upreference
1300       unsigned Level = --UpRefs[i].NestingLevel;
1301       UpRefs[i].LastContainedTy = Ty;
1302       UR_OUT("  Uplevel Ref Level = " << Level << "\n");
1303       if (Level == 0) {                     // Upreference should be resolved!
1304         if (!TypeToResolve) {
1305           TypeToResolve = UpRefs[i].UpRefTy;
1306         } else {
1307           UR_OUT("  * Resolving upreference for "
1308                  << UpRefs[i].second->getDescription() << "\n";
1309                  std::string OldName = UpRefs[i].UpRefTy->getDescription());
1310           UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1311           UR_OUT("  * Type '" << OldName << "' refined upreference to: "
1312                  << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1313         }
1314         UpRefs.erase(UpRefs.begin()+i);     // Remove from upreference list...
1315         --i;                                // Do not skip the next element...
1316       }
1317     }
1318   }
1319
1320   if (TypeToResolve) {
1321     UR_OUT("  * Resolving upreference for "
1322            << UpRefs[i].second->getDescription() << "\n";
1323            std::string OldName = TypeToResolve->getDescription());
1324     TypeToResolve->refineAbstractTypeTo(Ty);
1325   }
1326
1327   return Ty;
1328 }
1329
1330 //===----------------------------------------------------------------------===//
1331 //            RunVMAsmParser - Define an interface to this parser
1332 //===----------------------------------------------------------------------===//
1333 //
1334 static Module* RunParser(Module * M);
1335
1336 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1337   InitLLLexer(MB);
1338   Module *M = RunParser(new Module(LLLgetFilename()));
1339   FreeLexer();
1340   return M;
1341 }
1342
1343
1344
1345 /* Enabling traces.  */
1346 #ifndef YYDEBUG
1347 # define YYDEBUG 0
1348 #endif
1349
1350 /* Enabling verbose error messages.  */
1351 #ifdef YYERROR_VERBOSE
1352 # undef YYERROR_VERBOSE
1353 # define YYERROR_VERBOSE 1
1354 #else
1355 # define YYERROR_VERBOSE 0
1356 #endif
1357
1358 /* Enabling the token table.  */
1359 #ifndef YYTOKEN_TABLE
1360 # define YYTOKEN_TABLE 0
1361 #endif
1362
1363 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1364 typedef union YYSTYPE
1365 #line 967 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
1366 {
1367   llvm::Module                           *ModuleVal;
1368   llvm::Function                         *FunctionVal;
1369   llvm::BasicBlock                       *BasicBlockVal;
1370   llvm::TerminatorInst                   *TermInstVal;
1371   llvm::Instruction                      *InstVal;
1372   llvm::Constant                         *ConstVal;
1373
1374   const llvm::Type                       *PrimType;
1375   std::list<llvm::PATypeHolder>          *TypeList;
1376   llvm::PATypeHolder                     *TypeVal;
1377   llvm::Value                            *ValueVal;
1378   std::vector<llvm::Value*>              *ValueList;
1379   std::vector<unsigned>                  *ConstantList;
1380   llvm::ArgListType                      *ArgList;
1381   llvm::TypeWithAttrs                     TypeWithAttrs;
1382   llvm::TypeWithAttrsList                *TypeWithAttrsList;
1383   llvm::ParamList                        *ParamList;
1384
1385   // Represent the RHS of PHI node
1386   std::list<std::pair<llvm::Value*,
1387                       llvm::BasicBlock*> > *PHIList;
1388   std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1389   std::vector<llvm::Constant*>           *ConstVector;
1390
1391   llvm::GlobalValue::LinkageTypes         Linkage;
1392   llvm::GlobalValue::VisibilityTypes      Visibility;
1393   llvm::ParameterAttributes         ParamAttrs;
1394   llvm::APInt                       *APIntVal;
1395   int64_t                           SInt64Val;
1396   uint64_t                          UInt64Val;
1397   int                               SIntVal;
1398   unsigned                          UIntVal;
1399   llvm::APFloat                    *FPVal;
1400   bool                              BoolVal;
1401
1402   std::string                      *StrVal;   // This memory must be deleted
1403   llvm::ValID                       ValIDVal;
1404
1405   llvm::Instruction::BinaryOps      BinaryOpVal;
1406   llvm::Instruction::TermOps        TermOpVal;
1407   llvm::Instruction::MemoryOps      MemOpVal;
1408   llvm::Instruction::CastOps        CastOpVal;
1409   llvm::Instruction::OtherOps       OtherOpVal;
1410   llvm::ICmpInst::Predicate         IPredicate;
1411   llvm::FCmpInst::Predicate         FPredicate;
1412 }
1413 /* Line 193 of yacc.c.  */
1414 #line 1415 "llvmAsmParser.tab.c"
1415         YYSTYPE;
1416 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1417 # define YYSTYPE_IS_DECLARED 1
1418 # define YYSTYPE_IS_TRIVIAL 1
1419 #endif
1420
1421
1422
1423 /* Copy the second part of user declarations.  */
1424
1425
1426 /* Line 216 of yacc.c.  */
1427 #line 1428 "llvmAsmParser.tab.c"
1428
1429 #ifdef short
1430 # undef short
1431 #endif
1432
1433 #ifdef YYTYPE_UINT8
1434 typedef YYTYPE_UINT8 yytype_uint8;
1435 #else
1436 typedef unsigned char yytype_uint8;
1437 #endif
1438
1439 #ifdef YYTYPE_INT8
1440 typedef YYTYPE_INT8 yytype_int8;
1441 #elif (defined __STDC__ || defined __C99__FUNC__ \
1442      || defined __cplusplus || defined _MSC_VER)
1443 typedef signed char yytype_int8;
1444 #else
1445 typedef short int yytype_int8;
1446 #endif
1447
1448 #ifdef YYTYPE_UINT16
1449 typedef YYTYPE_UINT16 yytype_uint16;
1450 #else
1451 typedef unsigned short int yytype_uint16;
1452 #endif
1453
1454 #ifdef YYTYPE_INT16
1455 typedef YYTYPE_INT16 yytype_int16;
1456 #else
1457 typedef short int yytype_int16;
1458 #endif
1459
1460 #ifndef YYSIZE_T
1461 # ifdef __SIZE_TYPE__
1462 #  define YYSIZE_T __SIZE_TYPE__
1463 # elif defined size_t
1464 #  define YYSIZE_T size_t
1465 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1466      || defined __cplusplus || defined _MSC_VER)
1467 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1468 #  define YYSIZE_T size_t
1469 # else
1470 #  define YYSIZE_T unsigned int
1471 # endif
1472 #endif
1473
1474 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1475
1476 #ifndef YY_
1477 # if defined YYENABLE_NLS && YYENABLE_NLS
1478 #  if ENABLE_NLS
1479 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1480 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
1481 #  endif
1482 # endif
1483 # ifndef YY_
1484 #  define YY_(msgid) msgid
1485 # endif
1486 #endif
1487
1488 /* Suppress unused-variable warnings by "using" E.  */
1489 #if ! defined lint || defined __GNUC__
1490 # define YYUSE(e) ((void) (e))
1491 #else
1492 # define YYUSE(e) /* empty */
1493 #endif
1494
1495 /* Identity function, used to suppress warnings about constant conditions.  */
1496 #ifndef lint
1497 # define YYID(n) (n)
1498 #else
1499 #if (defined __STDC__ || defined __C99__FUNC__ \
1500      || defined __cplusplus || defined _MSC_VER)
1501 static int
1502 YYID (int i)
1503 #else
1504 static int
1505 YYID (i)
1506     int i;
1507 #endif
1508 {
1509   return i;
1510 }
1511 #endif
1512
1513 #if ! defined yyoverflow || YYERROR_VERBOSE
1514
1515 /* The parser invokes alloca or malloc; define the necessary symbols.  */
1516
1517 # ifdef YYSTACK_USE_ALLOCA
1518 #  if YYSTACK_USE_ALLOCA
1519 #   ifdef __GNUC__
1520 #    define YYSTACK_ALLOC __builtin_alloca
1521 #   elif defined __BUILTIN_VA_ARG_INCR
1522 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1523 #   elif defined _AIX
1524 #    define YYSTACK_ALLOC __alloca
1525 #   elif defined _MSC_VER
1526 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1527 #    define alloca _alloca
1528 #   else
1529 #    define YYSTACK_ALLOC alloca
1530 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1531      || defined __cplusplus || defined _MSC_VER)
1532 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1533 #     ifndef _STDLIB_H
1534 #      define _STDLIB_H 1
1535 #     endif
1536 #    endif
1537 #   endif
1538 #  endif
1539 # endif
1540
1541 # ifdef YYSTACK_ALLOC
1542    /* Pacify GCC's `empty if-body' warning.  */
1543 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1544 #  ifndef YYSTACK_ALLOC_MAXIMUM
1545     /* The OS might guarantee only one guard page at the bottom of the stack,
1546        and a page size can be as small as 4096 bytes.  So we cannot safely
1547        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
1548        to allow for a few compiler-allocated temporary stack slots.  */
1549 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1550 #  endif
1551 # else
1552 #  define YYSTACK_ALLOC YYMALLOC
1553 #  define YYSTACK_FREE YYFREE
1554 #  ifndef YYSTACK_ALLOC_MAXIMUM
1555 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1556 #  endif
1557 #  if (defined __cplusplus && ! defined _STDLIB_H \
1558        && ! ((defined YYMALLOC || defined malloc) \
1559              && (defined YYFREE || defined free)))
1560 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1561 #   ifndef _STDLIB_H
1562 #    define _STDLIB_H 1
1563 #   endif
1564 #  endif
1565 #  ifndef YYMALLOC
1566 #   define YYMALLOC malloc
1567 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1568      || defined __cplusplus || defined _MSC_VER)
1569 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1570 #   endif
1571 #  endif
1572 #  ifndef YYFREE
1573 #   define YYFREE free
1574 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1575      || defined __cplusplus || defined _MSC_VER)
1576 void free (void *); /* INFRINGES ON USER NAME SPACE */
1577 #   endif
1578 #  endif
1579 # endif
1580 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1581
1582
1583 #if (! defined yyoverflow \
1584      && (! defined __cplusplus \
1585          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1586
1587 /* A type that is properly aligned for any stack member.  */
1588 union yyalloc
1589 {
1590   yytype_int16 yyss;
1591   YYSTYPE yyvs;
1592   };
1593
1594 /* The size of the maximum gap between one aligned stack and the next.  */
1595 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1596
1597 /* The size of an array large to enough to hold all stacks, each with
1598    N elements.  */
1599 # define YYSTACK_BYTES(N) \
1600      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1601       + YYSTACK_GAP_MAXIMUM)
1602
1603 /* Copy COUNT objects from FROM to TO.  The source and destination do
1604    not overlap.  */
1605 # ifndef YYCOPY
1606 #  if defined __GNUC__ && 1 < __GNUC__
1607 #   define YYCOPY(To, From, Count) \
1608       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1609 #  else
1610 #   define YYCOPY(To, From, Count)              \
1611       do                                        \
1612         {                                       \
1613           YYSIZE_T yyi;                         \
1614           for (yyi = 0; yyi < (Count); yyi++)   \
1615             (To)[yyi] = (From)[yyi];            \
1616         }                                       \
1617       while (YYID (0))
1618 #  endif
1619 # endif
1620
1621 /* Relocate STACK from its old location to the new one.  The
1622    local variables YYSIZE and YYSTACKSIZE give the old and new number of
1623    elements in the stack, and YYPTR gives the new location of the
1624    stack.  Advance YYPTR to a properly aligned location for the next
1625    stack.  */
1626 # define YYSTACK_RELOCATE(Stack)                                        \
1627     do                                                                  \
1628       {                                                                 \
1629         YYSIZE_T yynewbytes;                                            \
1630         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
1631         Stack = &yyptr->Stack;                                          \
1632         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1633         yyptr += yynewbytes / sizeof (*yyptr);                          \
1634       }                                                                 \
1635     while (YYID (0))
1636
1637 #endif
1638
1639 /* YYFINAL -- State number of the termination state.  */
1640 #define YYFINAL  44
1641 /* YYLAST -- Last index in YYTABLE.  */
1642 #define YYLAST   2360
1643
1644 /* YYNTOKENS -- Number of terminals.  */
1645 #define YYNTOKENS  170
1646 /* YYNNTS -- Number of nonterminals.  */
1647 #define YYNNTS  86
1648 /* YYNRULES -- Number of rules.  */
1649 #define YYNRULES  342
1650 /* YYNRULES -- Number of states.  */
1651 #define YYNSTATES  701
1652
1653 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
1654 #define YYUNDEFTOK  2
1655 #define YYMAXUTOK   410
1656
1657 #define YYTRANSLATE(YYX)                                                \
1658   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1659
1660 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
1661 static const yytype_uint8 yytranslate[] =
1662 {
1663        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1664        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1665        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1666        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1667      156,   157,   160,     2,   159,     2,     2,     2,     2,     2,
1668        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1669      165,   158,   166,     2,     2,     2,     2,     2,     2,     2,
1670        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1671        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1672        2,   162,   161,   164,     2,     2,     2,     2,     2,   169,
1673        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1674        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1675      163,     2,     2,   167,     2,   168,     2,     2,     2,     2,
1676        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1677        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1678        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1679        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1680        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1681        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1682        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1683        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1684        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1685        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1686        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1687        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1688        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
1689        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
1690       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
1691       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
1692       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
1693       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
1694       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
1695       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
1696       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
1697       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
1698       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
1699      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
1700      115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
1701      125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
1702      135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
1703      145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
1704      155
1705 };
1706
1707 #if YYDEBUG
1708 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1709    YYRHS.  */
1710 static const yytype_uint16 yyprhs[] =
1711 {
1712        0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
1713       19,    21,    23,    25,    27,    29,    31,    33,    35,    37,
1714       39,    41,    43,    45,    47,    49,    51,    53,    55,    57,
1715       59,    61,    63,    65,    67,    69,    71,    73,    75,    77,
1716       79,    81,    83,    85,    87,    89,    91,    93,    95,    97,
1717       99,   101,   103,   105,   107,   109,   111,   113,   115,   117,
1718      119,   121,   123,   125,   127,   129,   130,   135,   136,   139,
1719      140,   142,   144,   146,   147,   150,   152,   154,   156,   158,
1720      160,   162,   164,   166,   168,   169,   171,   173,   175,   176,
1721      178,   180,   181,   183,   185,   187,   189,   190,   192,   194,
1722      195,   197,   199,   201,   203,   205,   208,   210,   212,   214,
1723      216,   218,   220,   222,   224,   226,   229,   230,   233,   235,
1724      237,   239,   241,   243,   245,   246,   249,   250,   253,   254,
1725      257,   258,   262,   265,   266,   268,   269,   273,   275,   278,
1726      280,   282,   284,   286,   288,   290,   292,   294,   296,   300,
1727      302,   305,   311,   317,   323,   329,   333,   336,   342,   347,
1728      350,   352,   354,   356,   360,   362,   366,   368,   369,   371,
1729      375,   380,   384,   388,   393,   398,   402,   409,   415,   418,
1730      421,   424,   427,   430,   433,   436,   439,   442,   445,   448,
1731      451,   458,   464,   473,   480,   487,   495,   503,   511,   519,
1732      526,   535,   544,   550,   558,   562,   564,   566,   568,   570,
1733      571,   574,   581,   583,   584,   586,   589,   590,   594,   595,
1734      599,   603,   607,   611,   612,   621,   622,   632,   633,   643,
1735      649,   652,   656,   658,   662,   666,   670,   674,   676,   677,
1736      683,   687,   689,   693,   695,   696,   707,   709,   711,   716,
1737      718,   720,   723,   727,   728,   730,   732,   734,   736,   738,
1738      740,   742,   744,   746,   748,   750,   754,   758,   761,   764,
1739      768,   771,   777,   782,   784,   790,   792,   794,   796,   798,
1740      800,   802,   805,   807,   811,   814,   817,   821,   824,   825,
1741      827,   830,   833,   837,   847,   857,   866,   881,   883,   885,
1742      892,   898,   901,   908,   916,   921,   926,   933,   940,   941,
1743      942,   946,   949,   953,   956,   958,   964,   970,   977,   984,
1744      991,   998,  1003,  1010,  1015,  1020,  1027,  1034,  1037,  1046,
1745     1048,  1050,  1051,  1055,  1062,  1066,  1073,  1076,  1082,  1090,
1746     1096,  1101,  1106
1747 };
1748
1749 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
1750 static const yytype_int16 yyrhs[] =
1751 {
1752      216,     0,    -1,    75,    -1,    76,    -1,    77,    -1,    78,
1753       -1,    79,    -1,    80,    -1,    81,    -1,    82,    -1,    83,
1754       -1,    87,    -1,    88,    -1,    89,    -1,    84,    -1,    85,
1755       -1,    86,    -1,   120,    -1,   121,    -1,   122,    -1,   123,
1756       -1,   124,    -1,   125,    -1,   126,    -1,   127,    -1,   128,
1757       -1,   129,    -1,   130,    -1,   131,    -1,    94,    -1,    95,
1758       -1,    96,    -1,    97,    -1,    98,    -1,    99,    -1,   100,
1759       -1,   101,    -1,   102,    -1,   103,    -1,   104,    -1,   105,
1760       -1,   106,    -1,   107,    -1,   108,    -1,   109,    -1,   110,
1761       -1,   111,    -1,   112,    -1,   113,    -1,   100,    -1,   101,
1762       -1,   102,    -1,   103,    -1,    26,    -1,    27,    -1,    11,
1763       -1,    12,    -1,    13,    -1,    16,    -1,    15,    -1,    14,
1764       -1,    19,    -1,    22,    -1,    24,    -1,   178,    -1,    -1,
1765       55,   156,     4,   157,    -1,    -1,   178,   158,    -1,    -1,
1766       20,    -1,    23,    -1,   184,    -1,    -1,   182,   158,    -1,
1767       42,    -1,    44,    -1,    43,    -1,    45,    -1,    47,    -1,
1768       49,    -1,    46,    -1,    48,    -1,    51,    -1,    -1,   153,
1769       -1,   154,    -1,   155,    -1,    -1,    46,    -1,    48,    -1,
1770       -1,    42,    -1,    43,    -1,    44,    -1,    47,    -1,    -1,
1771       44,    -1,    42,    -1,    -1,    63,    -1,    64,    -1,    65,
1772       -1,    66,    -1,    67,    -1,    62,     4,    -1,   142,    -1,
1773      121,    -1,   141,    -1,   122,    -1,   144,    -1,   145,    -1,
1774      147,    -1,   148,    -1,   149,    -1,    54,     4,    -1,    -1,
1775      193,   192,    -1,   143,    -1,   146,    -1,   142,    -1,   141,
1776       -1,   150,    -1,   151,    -1,    -1,   195,   194,    -1,    -1,
1777      152,    22,    -1,    -1,    54,     4,    -1,    -1,   159,    54,
1778        4,    -1,    34,    22,    -1,    -1,   199,    -1,    -1,   159,
1779      202,   201,    -1,   199,    -1,    54,     4,    -1,    11,    -1,
1780       12,    -1,    13,    -1,    16,    -1,    15,    -1,    14,    -1,
1781       17,    -1,    50,    -1,   203,    -1,   204,   180,   160,    -1,
1782      238,    -1,   161,     4,    -1,   204,   156,   208,   157,   195,
1783       -1,    10,   156,   208,   157,   195,    -1,   162,     4,   163,
1784      204,   164,    -1,   165,     4,   163,   204,   166,    -1,   167,
1785      209,   168,    -1,   167,   168,    -1,   165,   167,   209,   168,
1786      166,    -1,   165,   167,   168,   166,    -1,   204,   193,    -1,
1787      204,    -1,    10,    -1,   205,    -1,   207,   159,   205,    -1,
1788      207,    -1,   207,   159,    39,    -1,    39,    -1,    -1,   204,
1789       -1,   209,   159,   204,    -1,   204,   162,   212,   164,    -1,
1790      204,   162,   164,    -1,   204,   169,    22,    -1,   204,   165,
1791      212,   166,    -1,   204,   167,   212,   168,    -1,   204,   167,
1792      168,    -1,   204,   165,   167,   212,   168,   166,    -1,   204,
1793      165,   167,   168,   166,    -1,   204,    40,    -1,   204,    41,
1794       -1,   204,   238,    -1,   204,   211,    -1,   204,    25,    -1,
1795      176,     3,    -1,   176,     5,    -1,   176,     4,    -1,   176,
1796        6,    -1,    11,    26,    -1,    11,    27,    -1,   177,     9,
1797       -1,   173,   156,   210,    38,   204,   157,    -1,   119,   156,
1798      210,   250,   157,    -1,   133,   156,   210,   159,   210,   159,
1799      210,   157,    -1,   171,   156,   210,   159,   210,   157,    -1,
1800      172,   156,   210,   159,   210,   157,    -1,    90,   174,   156,
1801      210,   159,   210,   157,    -1,    91,   175,   156,   210,   159,
1802      210,   157,    -1,    92,   174,   156,   210,   159,   210,   157,
1803       -1,    93,   175,   156,   210,   159,   210,   157,    -1,   135,
1804      156,   210,   159,   210,   157,    -1,   136,   156,   210,   159,
1805      210,   159,   210,   157,    -1,   137,   156,   210,   159,   210,
1806      159,   210,   157,    -1,   139,   156,   210,   251,   157,    -1,
1807      140,   156,   210,   159,   210,   251,   157,    -1,   212,   159,
1808      210,    -1,   210,    -1,    32,    -1,    33,    -1,    37,    -1,
1809       -1,   206,   238,    -1,   125,   156,   215,    38,   204,   157,
1810       -1,   217,    -1,    -1,   218,    -1,   217,   218,    -1,    -1,
1811       31,   219,   234,    -1,    -1,    30,   220,   235,    -1,    60,
1812       59,   224,    -1,   181,    18,   204,    -1,   181,    18,    10,
1813       -1,    -1,   183,   187,   214,   213,   210,   180,   221,   201,
1814       -1,    -1,   183,   185,   187,   214,   213,   210,   180,   222,
1815      201,    -1,    -1,   183,   186,   187,   214,   213,   204,   180,
1816      223,   201,    -1,   183,   187,    35,   190,   215,    -1,    52,
1817      225,    -1,    56,   158,   226,    -1,    22,    -1,    53,   158,
1818       22,    -1,    68,   158,    22,    -1,   162,   227,   164,    -1,
1819      227,   159,    22,    -1,    22,    -1,    -1,   228,   159,   204,
1820      193,   179,    -1,   204,   193,   179,    -1,   228,    -1,   228,
1821      159,    39,    -1,    39,    -1,    -1,   191,   206,   182,   156,
1822      229,   157,   195,   200,   197,   196,    -1,    28,    -1,   167,
1823       -1,   189,   187,   230,   231,    -1,    29,    -1,   168,    -1,
1824      242,   233,    -1,   188,   187,   230,    -1,    -1,    61,    -1,
1825        3,    -1,     4,    -1,     5,    -1,     6,    -1,     9,    -1,
1826       26,    -1,    27,    -1,    40,    -1,    41,    -1,    25,    -1,
1827      165,   212,   166,    -1,   162,   212,   164,    -1,   162,   164,
1828       -1,   169,    22,    -1,   167,   212,   168,    -1,   167,   168,
1829       -1,   165,   167,   212,   168,   166,    -1,   165,   167,   168,
1830      166,    -1,   211,    -1,    59,   236,    22,   159,    22,    -1,
1831        7,    -1,     8,    -1,   178,    -1,   182,    -1,   238,    -1,
1832      237,    -1,   204,   239,    -1,   240,    -1,   241,   159,   240,
1833       -1,   242,   243,    -1,   232,   243,    -1,   244,   181,   245,
1834       -1,   244,   247,    -1,    -1,    21,    -1,    69,   241,    -1,
1835       69,    10,    -1,    70,    17,   239,    -1,    70,    11,   239,
1836      159,    17,   239,   159,    17,   239,    -1,    71,   176,   239,
1837      159,    17,   239,   162,   246,   164,    -1,    71,   176,   239,
1838      159,    17,   239,   162,   164,    -1,    72,   191,   206,   239,
1839      156,   249,   157,   195,    38,    17,   239,    73,    17,   239,
1840       -1,    73,    -1,    74,    -1,   246,   176,   237,   159,    17,
1841      239,    -1,   176,   237,   159,    17,   239,    -1,   181,   253,
1842       -1,   204,   162,   239,   159,   239,   164,    -1,   248,   159,
1843      162,   239,   159,   239,   164,    -1,   204,   193,   239,   193,
1844       -1,    17,   193,   239,   193,    -1,   249,   159,   204,   193,
1845      239,   193,    -1,   249,   159,    17,   193,   239,   193,    -1,
1846       -1,    -1,   250,   159,   240,    -1,   159,     4,    -1,   251,
1847      159,     4,    -1,    58,    57,    -1,    57,    -1,   171,   204,
1848      239,   159,   239,    -1,   172,   204,   239,   159,   239,    -1,
1849       90,   174,   204,   239,   159,   239,    -1,    91,   175,   204,
1850      239,   159,   239,    -1,    92,   174,   204,   239,   159,   239,
1851       -1,    93,   175,   204,   239,   159,   239,    -1,   173,   240,
1852       38,   204,    -1,   133,   240,   159,   240,   159,   240,    -1,
1853      134,   240,   159,   204,    -1,   135,   240,   159,   240,    -1,
1854      136,   240,   159,   240,   159,   240,    -1,   137,   240,   159,
1855      240,   159,   240,    -1,   132,   248,    -1,   252,   191,   206,
1856      239,   156,   249,   157,   195,    -1,   255,    -1,    36,    -1,
1857       -1,   114,   204,   198,    -1,   114,   204,   159,    11,   239,
1858      198,    -1,   115,   204,   198,    -1,   115,   204,   159,    11,
1859      239,   198,    -1,   116,   240,    -1,   254,   117,   204,   239,
1860      198,    -1,   254,   118,   240,   159,   204,   239,   198,    -1,
1861      138,   204,   239,   159,     4,    -1,   119,   204,   239,   250,
1862       -1,   139,   204,   239,   251,    -1,   140,   204,   239,   159,
1863      204,   239,   251,    -1
1864 };
1865
1866 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
1867 static const yytype_uint16 yyrline[] =
1868 {
1869        0,  1132,  1132,  1132,  1132,  1132,  1132,  1132,  1132,  1132,
1870     1132,  1133,  1133,  1133,  1133,  1133,  1133,  1134,  1134,  1134,
1871     1134,  1134,  1134,  1135,  1135,  1135,  1135,  1135,  1135,  1138,
1872     1138,  1139,  1139,  1140,  1140,  1141,  1141,  1142,  1142,  1146,
1873     1146,  1147,  1147,  1148,  1148,  1149,  1149,  1150,  1150,  1151,
1874     1151,  1152,  1152,  1153,  1154,  1159,  1160,  1160,  1160,  1160,
1875     1160,  1162,  1162,  1162,  1163,  1163,  1165,  1166,  1170,  1174,
1876     1179,  1179,  1181,  1182,  1187,  1193,  1194,  1195,  1196,  1197,
1877     1198,  1202,  1203,  1204,  1208,  1209,  1210,  1211,  1215,  1216,
1878     1217,  1221,  1222,  1223,  1224,  1225,  1229,  1230,  1231,  1234,
1879     1235,  1236,  1237,  1238,  1239,  1240,  1247,  1248,  1249,  1250,
1880     1251,  1252,  1253,  1254,  1255,  1256,  1260,  1261,  1266,  1267,
1881     1268,  1269,  1270,  1271,  1274,  1275,  1280,  1281,  1288,  1289,
1882     1295,  1296,  1305,  1313,  1314,  1319,  1320,  1321,  1326,  1339,
1883     1339,  1339,  1339,  1339,  1339,  1339,  1342,  1346,  1350,  1357,
1884     1362,  1370,  1399,  1424,  1429,  1439,  1449,  1453,  1463,  1470,
1885     1479,  1486,  1491,  1496,  1503,  1504,  1511,  1518,  1526,  1532,
1886     1544,  1572,  1588,  1615,  1643,  1669,  1689,  1715,  1735,  1747,
1887     1754,  1820,  1830,  1840,  1846,  1856,  1862,  1872,  1878,  1884,
1888     1897,  1909,  1930,  1938,  1944,  1955,  1960,  1965,  1970,  1975,
1889     1981,  1987,  1993,  2001,  2012,  2016,  2024,  2024,  2027,  2027,
1890     2030,  2042,  2063,  2068,  2076,  2077,  2081,  2081,  2085,  2085,
1891     2088,  2091,  2115,  2127,  2126,  2138,  2137,  2147,  2146,  2157,
1892     2197,  2200,  2206,  2216,  2220,  2225,  2227,  2232,  2237,  2246,
1893     2256,  2267,  2271,  2280,  2289,  2294,  2423,  2423,  2425,  2434,
1894     2434,  2436,  2441,  2453,  2457,  2462,  2466,  2470,  2475,  2480,
1895     2484,  2488,  2492,  2496,  2500,  2504,  2526,  2548,  2554,  2567,
1896     2579,  2584,  2596,  2602,  2606,  2616,  2620,  2624,  2629,  2636,
1897     2636,  2642,  2651,  2656,  2661,  2665,  2674,  2683,  2692,  2696,
1898     2704,  2711,  2715,  2720,  2731,  2750,  2759,  2845,  2849,  2856,
1899     2867,  2880,  2890,  2901,  2911,  2922,  2930,  2940,  2947,  2950,
1900     2951,  2959,  2965,  2974,  2978,  2983,  2999,  3016,  3030,  3044,
1901     3058,  3072,  3084,  3092,  3099,  3105,  3111,  3117,  3132,  3222,
1902     3227,  3231,  3238,  3245,  3255,  3262,  3272,  3280,  3294,  3311,
1903     3319,  3334,  3349
1904 };
1905 #endif
1906
1907 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1908 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1909    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
1910 static const char *const yytname[] =
1911 {
1912   "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1913   "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1914   "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1915   "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1916   "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1917   "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1918   "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1919   "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1920   "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1921   "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1922   "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1923   "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1924   "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1925   "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1926   "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1927   "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1928   "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1929   "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1930   "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1931   "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1932   "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1933   "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1934   "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1935   "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED", "'('",
1936   "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'",
1937   "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps",
1938   "IPredicates", "FPredicates", "IntType", "FPType", "LocalName",
1939   "OptLocalName", "OptAddrSpace", "OptLocalAssign", "GlobalName",
1940   "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1941   "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1942   "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1943   "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
1944   "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
1945   "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
1946   "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
1947   "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
1948   "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
1949   "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
1950   "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
1951   "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
1952   "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal",
1953   "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst",
1954   "JumpTable", "Inst", "PHIList", "ParamList", "IndexList",
1955   "ConstantIndexList", "OptTailCall", "InstVal", "OptVolatile",
1956   "MemoryInst", 0
1957 };
1958 #endif
1959
1960 # ifdef YYPRINT
1961 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1962    token YYLEX-NUM.  */
1963 static const yytype_uint16 yytoknum[] =
1964 {
1965        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
1966      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
1967      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
1968      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
1969      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
1970      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
1971      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
1972      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
1973      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
1974      345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
1975      355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
1976      365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
1977      375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
1978      385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
1979      395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
1980      405,   406,   407,   408,   409,   410,    40,    41,    61,    44,
1981       42,    92,    91,   120,    93,    60,    62,   123,   125,    99
1982 };
1983 # endif
1984
1985 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1986 static const yytype_uint8 yyr1[] =
1987 {
1988        0,   170,   171,   171,   171,   171,   171,   171,   171,   171,
1989      171,   172,   172,   172,   172,   172,   172,   173,   173,   173,
1990      173,   173,   173,   173,   173,   173,   173,   173,   173,   174,
1991      174,   174,   174,   174,   174,   174,   174,   174,   174,   175,
1992      175,   175,   175,   175,   175,   175,   175,   175,   175,   175,
1993      175,   175,   175,   175,   175,   176,   177,   177,   177,   177,
1994      177,   178,   178,   178,   179,   179,   180,   180,   181,   181,
1995      182,   182,   183,   183,   184,   185,   185,   185,   185,   185,
1996      185,   186,   186,   186,   187,   187,   187,   187,   188,   188,
1997      188,   189,   189,   189,   189,   189,   190,   190,   190,   191,
1998      191,   191,   191,   191,   191,   191,   192,   192,   192,   192,
1999      192,   192,   192,   192,   192,   192,   193,   193,   194,   194,
2000      194,   194,   194,   194,   195,   195,   196,   196,   197,   197,
2001      198,   198,   199,   200,   200,   201,   201,   202,   202,   203,
2002      203,   203,   203,   203,   203,   203,   204,   204,   204,   204,
2003      204,   204,   204,   204,   204,   204,   204,   204,   204,   205,
2004      206,   206,   207,   207,   208,   208,   208,   208,   209,   209,
2005      210,   210,   210,   210,   210,   210,   210,   210,   210,   210,
2006      210,   210,   210,   210,   210,   210,   210,   210,   210,   210,
2007      211,   211,   211,   211,   211,   211,   211,   211,   211,   211,
2008      211,   211,   211,   211,   212,   212,   213,   213,   214,   214,
2009      215,   215,   216,   216,   217,   217,   219,   218,   220,   218,
2010      218,   218,   218,   221,   218,   222,   218,   223,   218,   218,
2011      218,   218,   224,   225,   225,   226,   227,   227,   227,   228,
2012      228,   229,   229,   229,   229,   230,   231,   231,   232,   233,
2013      233,   234,   235,   236,   236,   237,   237,   237,   237,   237,
2014      237,   237,   237,   237,   237,   237,   237,   237,   237,   237,
2015      237,   237,   237,   237,   237,   238,   238,   238,   238,   239,
2016      239,   240,   241,   241,   242,   242,   243,   244,   244,   244,
2017      245,   245,   245,   245,   245,   245,   245,   245,   245,   246,
2018      246,   247,   248,   248,   249,   249,   249,   249,   249,   250,
2019      250,   251,   251,   252,   252,   253,   253,   253,   253,   253,
2020      253,   253,   253,   253,   253,   253,   253,   253,   253,   253,
2021      254,   254,   255,   255,   255,   255,   255,   255,   255,   255,
2022      255,   255,   255
2023 };
2024
2025 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
2026 static const yytype_uint8 yyr2[] =
2027 {
2028        0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
2029        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
2030        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
2031        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
2032        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
2033        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
2034        1,     1,     1,     1,     1,     0,     4,     0,     2,     0,
2035        1,     1,     1,     0,     2,     1,     1,     1,     1,     1,
2036        1,     1,     1,     1,     0,     1,     1,     1,     0,     1,
2037        1,     0,     1,     1,     1,     1,     0,     1,     1,     0,
2038        1,     1,     1,     1,     1,     2,     1,     1,     1,     1,
2039        1,     1,     1,     1,     1,     2,     0,     2,     1,     1,
2040        1,     1,     1,     1,     0,     2,     0,     2,     0,     2,
2041        0,     3,     2,     0,     1,     0,     3,     1,     2,     1,
2042        1,     1,     1,     1,     1,     1,     1,     1,     3,     1,
2043        2,     5,     5,     5,     5,     3,     2,     5,     4,     2,
2044        1,     1,     1,     3,     1,     3,     1,     0,     1,     3,
2045        4,     3,     3,     4,     4,     3,     6,     5,     2,     2,
2046        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
2047        6,     5,     8,     6,     6,     7,     7,     7,     7,     6,
2048        8,     8,     5,     7,     3,     1,     1,     1,     1,     0,
2049        2,     6,     1,     0,     1,     2,     0,     3,     0,     3,
2050        3,     3,     3,     0,     8,     0,     9,     0,     9,     5,
2051        2,     3,     1,     3,     3,     3,     3,     1,     0,     5,
2052        3,     1,     3,     1,     0,    10,     1,     1,     4,     1,
2053        1,     2,     3,     0,     1,     1,     1,     1,     1,     1,
2054        1,     1,     1,     1,     1,     3,     3,     2,     2,     3,
2055        2,     5,     4,     1,     5,     1,     1,     1,     1,     1,
2056        1,     2,     1,     3,     2,     2,     3,     2,     0,     1,
2057        2,     2,     3,     9,     9,     8,    14,     1,     1,     6,
2058        5,     2,     6,     7,     4,     4,     6,     6,     0,     0,
2059        3,     2,     3,     2,     1,     5,     5,     6,     6,     6,
2060        6,     4,     6,     4,     4,     6,     6,     2,     8,     1,
2061        1,     0,     3,     6,     3,     6,     2,     5,     7,     5,
2062        4,     4,     7
2063 };
2064
2065 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2066    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
2067    means the default is an error.  */
2068 static const yytype_uint16 yydefact[] =
2069 {
2070       73,    61,    70,    62,    71,    63,   218,   216,     0,     0,
2071        0,     0,     0,     0,    84,    72,     0,    73,   214,    88,
2072       91,     0,     0,   230,     0,     0,    68,     0,    74,    75,
2073       77,    76,    78,    81,    79,    82,    80,    83,    85,    86,
2074       87,    84,    84,   209,     1,   215,    89,    90,    84,   219,
2075       92,    93,    94,    95,    84,   288,   217,   288,     0,     0,
2076      238,   231,   232,   220,   275,   276,   222,   139,   140,   141,
2077      144,   143,   142,   145,   146,     0,     0,     0,     0,   277,
2078      278,   147,   221,   149,   209,   209,    96,   208,     0,    99,
2079       99,   289,   285,    69,   249,   250,   251,   284,   233,   234,
2080      237,     0,   167,   150,     0,     0,     0,     0,   156,   168,
2081        0,     0,   167,     0,     0,     0,    98,    97,     0,   206,
2082      207,     0,     0,   100,   101,   102,   103,   104,     0,   252,
2083        0,   331,   287,     0,   235,   166,   116,   162,   164,     0,
2084        0,     0,     0,     0,     0,   155,     0,     0,   148,     0,
2085        0,   161,     0,   160,     0,   229,   139,   140,   141,   144,
2086      143,   142,     0,     0,    67,    67,   105,     0,   246,   247,
2087      248,   330,   314,     0,     0,     0,     0,    99,   297,   298,
2088        2,     3,     4,     5,     6,     7,     8,     9,    10,    14,
2089       15,    16,    11,    12,    13,     0,     0,     0,     0,     0,
2090        0,     0,     0,    17,    18,    19,    20,    21,    22,    23,
2091       24,    25,    26,    27,    28,     0,     0,     0,     0,     0,
2092        0,     0,     0,     0,     0,     0,     0,   286,    99,   301,
2093        0,   329,   236,   159,     0,   124,    67,    67,   158,     0,
2094      169,     0,   124,    67,    67,     0,   210,   187,   188,   183,
2095      185,   184,   186,   189,   182,   178,   179,     0,     0,     0,
2096        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2097        0,     0,     0,     0,     0,   181,   180,   223,     0,   313,
2098      291,    67,   282,   290,     0,     0,    55,     0,     0,    29,
2099       30,    31,    32,    33,    34,    35,    36,    37,    38,     0,
2100       53,    54,    49,    50,    51,    52,    39,    40,    41,    42,
2101       43,    44,    45,    46,    47,    48,     0,     0,     0,   130,
2102      130,   336,    67,    67,   327,     0,     0,     0,     0,     0,
2103       67,    67,    67,    67,    67,     0,     0,     0,     0,     0,
2104      107,   109,   108,   106,   110,   111,   112,   113,   114,   117,
2105      165,   163,   152,   153,   154,   157,    66,   151,   225,   227,
2106        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2107        0,     0,   171,   205,     0,     0,     0,   175,     0,   172,
2108        0,     0,     0,   135,   244,   255,   256,   257,   258,   259,
2109      264,   260,   261,   262,   263,   253,     0,     0,     0,     0,
2110      273,   280,   279,   281,     0,     0,   292,     0,     0,    67,
2111       67,    67,    67,     0,   332,     0,   334,   309,     0,     0,
2112        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2113        0,     0,    67,     0,   115,   121,   120,   118,   119,   122,
2114      123,   125,   135,   135,     0,     0,     0,     0,     0,   309,
2115        0,     0,     0,     0,     0,     0,     0,   170,   156,   168,
2116        0,   173,   174,     0,     0,     0,     0,   224,   243,   116,
2117      241,     0,   254,     0,   267,     0,     0,     0,   270,     0,
2118      268,   283,     0,     0,     0,     0,     0,     0,     0,     0,
2119        0,     0,   340,     0,     0,     0,   323,   324,     0,     0,
2120        0,     0,   341,     0,     0,     0,   321,     0,   130,     0,
2121      226,   228,    67,     0,     0,     0,     0,     0,     0,     0,
2122        0,     0,     0,     0,   204,   177,     0,     0,     0,     0,
2123        0,     0,   137,   135,    65,     0,   124,     0,   266,   156,
2124        0,   265,   269,     0,     0,   308,     0,     0,     0,     0,
2125      130,   131,   130,     0,     0,     0,     0,     0,     0,   339,
2126      311,     0,    67,   315,   316,   308,     0,   337,    67,   211,
2127        0,     0,     0,     0,   191,     0,     0,     0,     0,   202,
2128        0,   176,     0,     0,    67,   132,   138,   136,    64,   240,
2129      242,   116,   133,     0,   272,     0,     0,     0,   116,   116,
2130        0,   317,   318,   319,   320,   333,   335,   310,     0,     0,
2131      322,   325,   326,   312,     0,     0,   130,     0,     0,     0,
2132        0,     0,   199,     0,     0,     0,   193,   194,   190,    65,
2133      134,   128,   274,   271,     0,     0,     0,     0,   124,     0,
2134      302,     0,   342,   124,   338,   195,   196,   197,   198,     0,
2135        0,     0,   203,   239,     0,   126,     0,   295,     0,     0,
2136      107,   109,   116,   116,     0,   116,   116,   303,   328,   192,
2137      200,   201,   129,     0,   245,   293,     0,   294,     0,   305,
2138      304,     0,     0,     0,   127,     0,     0,     0,   116,   116,
2139        0,     0,     0,   307,   306,   300,     0,     0,   299,     0,
2140      296
2141 };
2142
2143 /* YYDEFGOTO[NTERM-NUM].  */
2144 static const yytype_int16 yydefgoto[] =
2145 {
2146       -1,   272,   273,   274,   299,   316,   162,   163,    79,   589,
2147      113,    12,    80,    14,    15,    41,    42,    43,    48,    54,
2148      118,   128,   349,   233,   441,   352,   674,   655,   414,   532,
2149      631,   467,   533,    81,   164,   137,   154,   138,   139,   110,
2150      373,   400,   374,   121,    88,   155,    16,    17,    18,    20,
2151       19,   383,   442,   443,    63,    23,    61,   101,   470,   471,
2152      129,   170,    55,    96,    56,    49,   473,   401,    83,   403,
2153      282,   283,    57,    92,    93,   227,   659,   132,   324,   600,
2154      492,   502,   228,   229,   230,   231
2155 };
2156
2157 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2158    STATE-NUM.  */
2159 #define YYPACT_NINF -608
2160 static const yytype_int16 yypact[] =
2161 {
2162      492,  -608,  -608,  -608,  -608,  -608,  -608,  -608,     1,   -93,
2163       14,   -48,    39,   -39,    -3,  -608,   132,   926,  -608,    61,
2164      261,   -14,     6,  -608,   -15,   148,  -608,  1840,  -608,  -608,
2165     -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,
2166     -608,    69,    69,    88,  -608,  -608,  -608,  -608,    69,  -608,
2167     -608,  -608,  -608,  -608,    69,   120,  -608,   -11,   158,   166,
2168      184,  -608,  -608,  -608,  -608,  -608,    53,  -608,  -608,  -608,
2169     -608,  -608,  -608,  -608,  -608,   212,   222,    10,   812,  -608,
2170     -608,  -608,     9,  -608,   201,   201,   168,  -608,    56,   253,
2171      253,  -608,  -608,   323,  -608,  -608,  -608,  -608,  -608,  -608,
2172     -608,    66,  1570,  -608,    85,    93,  1260,    53,  -608,     9,
2173     -101,   121,  1570,   133,    56,    56,  -608,  -608,  1588,  -608,
2174     -608,  1869,   305,  -608,  -608,  -608,  -608,  -608,  1915,  -608,
2175      -12,  2220,  -608,   303,  -608,  -608,     9,  -608,   176,   170,
2176     2001,  2001,   177,   -91,  2001,  -608,   344,   193,  -608,  1869,
2177     2001,    53,   199,     9,   432,  -608,   296,   347,   348,   354,
2178      356,   357,   283,   362,  1365,   317,  -608,    55,  -608,  -608,
2179     -608,  -608,  -608,   316,  2033,    94,   363,   253,  -608,  -608,
2180     -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,
2181     -608,  -608,  -608,  -608,  -608,   464,   280,   464,   280,  2001,
2182     2001,  2001,  2001,  -608,  -608,  -608,  -608,  -608,  -608,  -608,
2183     -608,  -608,  -608,  -608,  -608,  2001,  2001,  2001,  2001,  2001,
2184     2001,  2001,  2001,  2001,  2001,  2001,  2001,  -608,   253,  -608,
2185       43,  -608,  -608,   192,  1620,  -608,   -35,   -40,  -608,   209,
2186        9,   219,  -608,   317,   -23,  1588,  -608,  -608,  -608,  -608,
2187     -608,  -608,  -608,  -608,  -608,  -608,  -608,   464,   280,   464,
2188      280,   221,   243,   245,   246,   247,   250,   251,  1749,  2051,
2189     1305,   386,   254,   256,   257,  -608,  -608,  -608,   259,  -608,
2190       53,   913,  -608,   258,  1080,  1080,  -608,  1080,  1915,  -608,
2191     -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  2001,
2192     -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,
2193     -608,  -608,  -608,  -608,  -608,  -608,  2001,  2001,  2001,   -29,
2194      -17,  -608,   913,   -34,   260,   262,   263,   264,   267,   268,
2195      913,   913,   913,   913,   913,   378,  1915,  2001,  2001,   416,
2196     -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,
2197     -608,  -608,   124,  -608,  -608,  -608,  -608,   124,  -608,   133,
2198      390,   273,   274,   275,   282,  1869,  1869,  1869,  1869,  1869,
2199     1869,  1869,  -608,  -608,    81,  1500,  -104,  -608,   -89,  -608,
2200     1869,  1869,  1869,   277,  1781,  -608,  -608,  -608,  -608,  -608,
2201     -608,  -608,  -608,  -608,  -608,   382,  1799,  2080,  1529,   422,
2202     -608,  -608,  -608,  -608,  2001,   286,  -608,   287,  1080,   913,
2203      913,   913,   913,    36,  -608,    49,  -608,  -608,  1080,   285,
2204     2001,  2001,  2001,  2001,  2001,   289,   290,   294,   298,   301,
2205     2001,  1080,   913,   311,  -608,  -608,  -608,  -608,  -608,  -608,
2206     -608,  -608,   277,   277,  2001,  1869,  1869,  1869,  1869,  -608,
2207      312,   313,   314,   319,   290,   320,  1869,  -608,   309,  1214,
2208      -87,  -608,  -608,   321,   322,   424,    -1,  -608,  -608,     9,
2209      331,   334,  -608,   454,  -608,    99,  1547,   -21,  -608,   -64,
2210     -608,  -608,   476,   477,   339,   338,   340,   341,   342,  1080,
2211      494,  1080,   343,   358,  1080,   359,     9,  -608,   361,   365,
2212      509,   517,   366,  2001,  1080,  1080,     9,   370,   369,  2001,
2213     -608,  -608,    11,   374,   377,   381,   383,    82,  1869,  1869,
2214     1869,  1869,    90,  1869,  -608,  -608,   375,  1869,  1869,  2001,
2215      521,   541,  -608,   277,    37,  1822,  -608,   387,  -608,   384,
2216      -51,  -608,  -608,  1080,  1080,  2098,  1080,  1080,  1080,  1080,
2217      369,  -608,   369,  2001,  1080,   388,  2001,  2001,  2001,  -608,
2218     -608,   545,   913,  -608,  -608,  2098,   497,  -608,   913,  -608,
2219     1869,  1869,  1869,  1869,  -608,   394,   397,   396,   409,  -608,
2220      290,  -608,   412,   413,    46,  -608,  -608,  -608,  -608,  -608,
2221     -608,     9,    86,   553,  -608,   414,   419,   417,    27,     9,
2222      119,  -608,  -608,  -608,  -608,  -608,  -608,  -608,   423,  1080,
2223     -608,  -608,  -608,  -608,   290,   167,   369,   431,   433,   434,
2224      439,  1869,  -608,  1869,  1869,   187,  -608,  -608,  -608,    37,
2225     -608,   527,  -608,  -608,   572,    -2,   762,   762,  -608,  2121,
2226     -608,   435,   366,  -608,  -608,  -608,  -608,  -608,  -608,   440,
2227      441,   443,  -608,  -608,   597,   452,  1080,  -608,   568,     2,
2228      455,   456,  -608,  -608,   118,    27,     9,  -608,   124,  -608,
2229     -608,  -608,  -608,   592,  -608,  -608,   458,  -608,   568,   192,
2230      192,   598,   762,   762,  -608,   601,   461,  1080,  -608,  -608,
2231     1080,   604,   549,   192,   192,  -608,  1080,   606,  -608,  1080,
2232     -608
2233 };
2234
2235 /* YYPGOTO[NTERM-NUM].  */
2236 static const yytype_int16 yypgoto[] =
2237 {
2238     -608,   493,   495,   499,  -174,  -164,  -170,  -608,     0,    -4,
2239     -146,   535,     5,  -608,  -608,  -608,  -608,    58,  -608,  -608,
2240     -608,  -141,  -608,  -445,  -608,  -238,  -608,  -608,  -295,    40,
2241     -608,  -393,  -608,  -608,   -26,   399,  -125,  -608,   519,   528,
2242      -86,  -162,  -262,   157,   269,   391,  -608,  -608,   618,  -608,
2243     -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,  -608,
2244      547,  -608,  -608,  -608,  -608,  -608,  -608,  -607,   -80,   174,
2245     -189,  -608,  -608,   581,  -608,  -608,  -608,  -608,  -608,    74,
2246      191,  -443,  -608,  -608,  -608,  -608
2247 };
2248
2249 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
2250    positive, shift that token.  If negative, reduce the rule which
2251    number is the opposite.  If zero, do what YYDEFACT says.
2252    If YYTABLE_NINF, syntax error.  */
2253 #define YYTABLE_NINF -214
2254 static const yytype_int16 yytable[] =
2255 {
2256       11,    82,   275,   167,   357,    13,   287,   376,   378,   286,
2257       91,   522,   321,   286,   105,   111,   168,    11,    94,   277,
2258      111,   111,    13,   317,   534,   416,   111,   325,   326,   327,
2259      328,   329,   111,   530,   318,   165,   288,   335,   111,    29,
2260       30,    31,    32,    33,    34,    35,    36,   489,    37,   510,
2261      511,   676,   109,   531,    21,   456,     1,    27,   144,     3,
2262      491,     5,   461,   243,   111,    24,   111,   145,   144,    22,
2263      456,   686,   456,    25,   246,     2,   136,   239,     4,   462,
2264      109,   526,  -145,   361,   276,   363,   136,   336,   119,   120,
2265      490,   339,   153,    11,   362,   456,   364,   358,   359,    84,
2266       85,   111,   153,   490,   542,   284,    89,    46,   456,    47,
2267       26,   285,    90,   460,   236,   237,   112,   595,   240,    28,
2268      530,   112,   112,    86,   244,    87,   354,   112,   418,   353,
2269      413,   -67,    44,   112,   475,   477,   479,   625,   456,   112,
2270      587,    91,   415,   -67,    58,   541,   629,    60,   281,   433,
2271       38,    39,    40,   636,   637,   169,   681,    95,   340,   341,
2272      337,   338,   657,   408,    59,   112,   677,   112,   569,   -67,
2273       62,   642,   278,   319,   320,   281,   322,   106,   342,   343,
2274       98,   344,   345,  -145,   346,   347,   348,  -145,    99,   323,
2275      281,   281,   281,   281,   281,   330,   331,   332,   333,   334,
2276      281,   402,   112,   628,   402,   402,   100,   402,   136,   102,
2277      116,   431,   117,   567,   540,   481,   103,   679,   680,   153,
2278      682,   683,    38,    39,    40,   133,   104,   435,   436,   437,
2279      134,   495,   438,   497,   498,   499,   439,   440,    87,   574,
2280      456,   553,   402,   693,   694,   457,   339,   579,   140,   561,
2281      402,   402,   402,   402,   402,   605,   141,   606,   456,   435,
2282      436,   437,   153,   538,   438,   435,   436,   437,   439,   440,
2283      438,   149,   150,   409,   439,   440,   638,   146,   639,   449,
2284      450,   451,   452,   453,   454,   455,   249,   250,   251,   252,
2285      410,   411,   412,   148,   463,   464,   465,   275,   592,   -55,
2286      -55,   -55,   -55,    50,    51,    52,   300,   301,    53,   166,
2287      153,   432,   281,   340,   341,   122,   123,   124,   125,   126,
2288      127,   644,   247,   248,   643,   232,   639,   235,   402,   402,
2289      402,   402,   402,   342,   343,   234,   344,   345,   402,   346,
2290      347,   348,     1,   238,   652,     3,   561,     5,   241,   459,
2291      242,   402,   402,   114,   115,   245,   -56,   -57,   469,   513,
2292      514,   515,   516,   -60,   607,   -59,   -58,   610,   611,   612,
2293      524,   253,   111,   279,   286,   355,   356,   365,   281,   276,
2294      302,   303,   304,   305,   306,   307,   308,   309,   310,   311,
2295      312,   313,   314,   315,   281,   496,   281,   281,   281,   366,
2296      664,   367,   368,   369,   506,   668,   370,   371,   379,   402,
2297      380,   402,   381,   382,   402,   384,   430,   404,   512,   419,
2298      434,   420,   421,   422,   402,   402,   423,   424,   444,   445,
2299      446,   447,   575,   576,   577,   578,   466,   580,   448,    64,
2300       65,   582,   583,   472,   480,   482,   483,   494,   500,   501,
2301      459,     1,     2,   503,     3,     4,     5,   504,   405,   406,
2302      505,   407,   529,   402,   402,   658,   402,   402,   402,   402,
2303      509,   518,   519,   520,   402,   525,   537,   562,   521,   523,
2304      527,   528,   402,   568,   617,   618,   619,   620,   402,   678,
2305      535,   536,  -213,   543,   544,   545,   417,   546,   551,   547,
2306      548,   549,   553,   584,   425,   426,   427,   428,   429,   591,
2307      -69,     1,     2,   559,     3,     4,     5,   554,   556,   599,
2308      557,   560,     6,     7,   558,   561,   565,   281,   566,   402,
2309      281,   281,   281,   570,   588,   649,   571,   650,   651,   599,
2310      572,   581,   573,   585,     8,   586,   593,   609,     9,   613,
2311      594,   490,    10,   621,   622,   623,   402,   402,   289,   290,
2312      291,   292,   293,   294,   295,   296,   297,   298,   624,   626,
2313      627,   385,   386,   387,   388,   632,   402,   389,   634,   635,
2314      633,   654,   484,   485,   486,   487,   488,   640,   645,   656,
2315      646,   647,   493,   390,   391,   392,   648,   669,   670,   667,
2316      671,   672,   402,   402,   673,   507,   508,   402,   393,   394,
2317      402,   -18,   -19,   666,   684,   687,   402,   685,   690,   402,
2318      691,   696,   697,   699,   224,   653,   225,   395,   131,   588,
2319      226,   147,   630,   351,   143,    45,   360,   130,    97,   615,
2320      517,     0,     0,   180,   181,   182,   183,   184,   185,   186,
2321      187,   188,   189,   190,   191,   192,   193,   194,   257,   258,
2322      259,   260,     0,   550,     0,   552,     0,     0,   555,     0,
2323        0,     0,     0,     0,     0,     0,     0,     0,   563,   564,
2324        0,     0,     0,     0,     0,     0,     0,   261,   203,   204,
2325      205,   206,   207,   208,   209,   210,   211,   212,   213,   214,
2326        0,   262,     0,   263,   264,   265,     0,   266,   267,     0,
2327        0,     0,     0,     0,     0,     0,     0,   596,   597,     0,
2328      601,   602,   603,   604,     0,     0,     0,     0,   608,     0,
2329      396,     0,     0,   397,     0,   398,   614,   399,     0,     0,
2330        0,     0,   616,     0,     0,     0,     0,     0,     0,     0,
2331        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2332        0,     0,     0,     0,     0,   385,   386,   387,   388,    64,
2333       65,   389,     0,     0,     0,     0,     0,     0,     0,     0,
2334        0,     1,     2,   641,     3,     4,     5,   390,   391,   392,
2335        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2336        0,     0,   393,   394,     0,     0,     0,     0,     0,     0,
2337      662,   663,     0,     0,     0,     0,   339,     0,     0,    64,
2338       65,   395,   107,    67,    68,    69,    70,    71,    72,    73,
2339      675,     1,     2,     0,     3,     4,     5,   180,   181,   182,
2340      183,   184,   185,   186,   187,   188,   189,   190,   191,   192,
2341      193,   194,   257,   258,   259,   260,   688,   689,     0,     0,
2342        0,   692,    74,     0,   695,     0,     0,     0,     0,     0,
2343      698,     0,     0,   700,     0,     0,     0,     0,     0,     0,
2344        0,   261,   203,   660,   661,   206,   207,   208,   209,   210,
2345      211,   212,   213,   214,     0,   262,     0,   263,   264,   265,
2346        0,   266,   267,   342,   343,     0,   344,   345,     0,   346,
2347      347,   348,     0,     0,     0,     0,   385,   386,   387,   388,
2348       64,    65,   389,     0,   396,     0,  -212,   397,     0,   398,
2349        0,   399,     1,     2,     0,     3,     4,     5,   390,   391,
2350      392,     0,     0,     0,   -69,     1,     2,     0,     3,     4,
2351        5,     0,     0,   393,   394,     0,     6,     7,     0,     0,
2352        0,     0,     0,     0,     0,     0,     0,     0,   111,     0,
2353        0,     0,   395,    75,    76,     0,     0,    77,     8,    78,
2354      108,     0,     9,     0,     0,     0,    10,     0,   180,   181,
2355      182,   183,   184,   185,   186,   187,   188,   189,   190,   191,
2356      192,   193,   194,   257,   258,   259,   260,     0,     0,     0,
2357        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2358        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2359        0,     0,   261,   203,   204,   205,   206,   207,   208,   209,
2360      210,   211,   212,   213,   214,     0,   262,     0,   263,   264,
2361      265,     0,   266,   267,     0,     0,     0,     0,     0,     0,
2362        0,     0,     0,     0,     0,     0,     0,     0,     0,   112,
2363        0,     0,     0,     0,     0,   396,     0,     0,   397,     0,
2364      398,     0,   399,   385,   386,   387,   388,    64,    65,   389,
2365        0,     0,     0,     0,     0,     0,     0,     0,     0,     1,
2366        2,     0,     3,     4,     5,   390,   391,   392,     0,     0,
2367        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2368      393,   394,     0,     0,     0,     0,     0,     0,     0,     0,
2369        0,     0,     0,     0,     0,     0,     0,     0,     0,   395,
2370        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2371        0,     0,     0,     0,     0,   180,   181,   182,   183,   184,
2372      185,   186,   187,   188,   189,   190,   191,   192,   193,   194,
2373      257,   258,   259,   260,     0,     0,     0,     0,     0,     0,
2374        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2375        0,     0,     0,     0,     0,     0,     0,     0,     0,   261,
2376      203,   204,   205,   206,   207,   208,   209,   210,   211,   212,
2377      213,   214,     0,   262,     0,   263,   264,   265,     0,   266,
2378      267,    64,    65,     0,     0,     0,     0,     0,     0,     0,
2379        0,     0,     0,     1,     2,     0,     3,     4,     5,   254,
2380        0,     0,   396,     0,     0,   397,     0,   398,     0,   399,
2381        0,     0,     0,     0,   255,   256,     0,     0,     0,     0,
2382        0,     0,     0,     0,     0,     0,     0,    64,    65,   111,
2383      107,    67,    68,    69,    70,    71,    72,    73,     0,     1,
2384        2,     0,     3,     4,     5,     0,     0,     0,     0,   180,
2385      181,   182,   183,   184,   185,   186,   187,   188,   189,   190,
2386      191,   192,   193,   194,   257,   258,   259,   260,     0,     0,
2387       74,     0,    64,    65,     0,   107,   156,   157,   158,   159,
2388      160,   161,    73,     0,     1,     2,     0,     3,     4,     5,
2389        0,     0,     0,   261,   203,   204,   205,   206,   207,   208,
2390      209,   210,   211,   212,   213,   214,     0,   262,     0,   263,
2391      264,   265,     0,   266,   267,    74,     0,     0,     0,     0,
2392        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2393      112,     0,    64,    65,   -67,     0,   268,     0,     0,   269,
2394        0,   270,     0,   271,     1,     2,     0,     3,     4,     5,
2395      254,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2396        0,     0,     0,     0,     0,   255,   256,     0,     0,     0,
2397        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2398      111,    75,    76,     0,     0,    77,     0,    78,   142,     0,
2399        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2400      180,   181,   182,   183,   184,   185,   186,   187,   188,   189,
2401      190,   191,   192,   193,   194,   257,   258,   259,   260,     0,
2402        0,     0,     0,     0,     0,     0,    75,    76,     0,     0,
2403       77,     0,    78,   377,     0,     0,     0,     0,     0,     0,
2404        0,     0,     0,     0,   261,   203,   204,   205,   206,   207,
2405      208,   209,   210,   211,   212,   213,   214,     0,   262,     0,
2406      263,   264,   265,     0,   266,   267,     0,    64,    65,     0,
2407      107,   156,   157,   158,   159,   160,   161,    73,     0,     1,
2408        2,   112,     3,     4,     5,     0,     0,   268,     0,     0,
2409      269,     0,   270,     0,   271,     0,    64,    65,     0,   107,
2410      156,   157,   158,   159,   160,   161,    73,     0,     1,     2,
2411       74,     3,     4,     5,    64,    65,     0,   107,   156,   157,
2412      158,   159,   160,   161,    73,     0,     1,     2,     0,     3,
2413        4,     5,     0,     0,     0,     0,     0,    64,    65,    74,
2414      107,    67,    68,    69,    70,    71,    72,    73,     0,     1,
2415        2,     0,     3,     4,     5,    64,    65,    74,   151,    67,
2416       68,    69,    70,    71,    72,    73,     0,     1,     2,   135,
2417        3,     4,     5,     0,     0,     0,     0,     0,     0,     0,
2418       74,     0,     0,     0,     0,     0,     0,    64,    65,     0,
2419      107,    67,    68,    69,    70,    71,    72,    73,    74,     1,
2420        2,     0,     3,     4,     5,     0,     0,     0,     0,     0,
2421        0,     0,     0,     0,     0,     0,     0,     0,     0,   350,
2422        0,    75,    76,     0,     0,    77,     0,    78,   458,     0,
2423       74,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2424        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2425       75,    76,     0,     0,    77,     0,    78,   478,     0,     0,
2426        0,     0,     0,     0,     0,     0,     0,     0,    75,    76,
2427        0,     0,    77,   152,    78,   539,     0,     0,     0,     0,
2428        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2429        0,    75,    76,     0,     0,    77,     0,    78,     0,     0,
2430        0,     0,     0,     0,     0,     0,     0,     0,     0,    75,
2431       76,     0,     0,    77,     0,    78,    64,    65,     0,   107,
2432      156,   157,   158,   159,   160,   161,    73,     0,     1,     2,
2433        0,     3,     4,     5,     0,     0,     0,     0,     0,     0,
2434        0,    75,    76,     0,     0,    77,     0,    78,    64,    65,
2435        0,   107,    67,    68,    69,    70,    71,    72,    73,    74,
2436        1,     2,     0,     3,     4,     5,    64,    65,     0,   107,
2437      156,   157,   158,   159,   160,   161,    73,     0,     1,     2,
2438      468,     3,     4,     5,     0,     0,     0,     0,     0,    64,
2439       65,    74,   107,    67,    68,    69,    70,    71,    72,    73,
2440        0,     1,     2,     0,     3,     4,     5,    64,    65,    74,
2441       66,    67,    68,    69,    70,    71,    72,    73,     0,     1,
2442        2,   590,     3,     4,     5,     0,     0,     0,     0,     0,
2443        0,     0,    74,     0,     0,     0,    64,    65,     0,   107,
2444      156,   157,   158,   159,   160,   161,    73,     0,     1,     2,
2445       74,     3,     4,     5,     0,     0,     0,     0,     0,     0,
2446        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2447       75,    76,     0,   372,    77,     0,    78,     0,     0,    74,
2448        0,     0,    64,    65,     0,   151,    67,    68,    69,    70,
2449       71,    72,    73,     0,     1,     2,     0,     3,     4,     5,
2450        0,     0,    75,    76,     0,     0,    77,     0,    78,     0,
2451        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2452       75,    76,     0,   474,    77,    74,    78,     0,     0,     0,
2453        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2454        0,     0,     0,    75,    76,     0,     0,    77,     0,    78,
2455        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2456        0,    75,    76,     0,     0,    77,     0,    78,    64,    65,
2457        0,   107,    67,    68,    69,    70,    71,    72,    73,     0,
2458        1,     2,     0,     3,     4,     5,     0,     0,     0,     0,
2459       75,    76,     0,     0,    77,     0,    78,     0,     0,     0,
2460       64,    65,     0,   280,    67,    68,    69,    70,    71,    72,
2461       73,    74,     1,     2,     0,     3,     4,     5,    64,    65,
2462        0,   107,   156,   157,   158,   159,   160,   161,    73,     0,
2463        1,     2,     0,     3,     4,     5,    75,    76,     0,     0,
2464       77,     0,    78,    74,     0,     0,     0,    64,    65,     0,
2465      107,   156,   157,   158,   159,   160,   161,    73,     0,     1,
2466        2,    74,     3,     4,     5,    64,    65,     0,   107,    67,
2467       68,    69,    70,    71,    72,   598,     0,     1,     2,     0,
2468        3,     4,     5,     0,     0,     0,     0,     0,    64,    65,
2469       74,   107,    67,    68,    69,    70,    71,    72,   665,     0,
2470        1,     2,     0,     3,     4,     5,     0,     0,    74,     0,
2471        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2472        0,     0,    75,    76,     0,     0,    77,     0,    78,     0,
2473        0,    74,     0,     0,     0,     0,     0,     0,     0,     0,
2474        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2475        0,     0,     0,     0,    75,    76,     0,     0,    77,     0,
2476       78,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2477        0,     0,    75,    76,     0,     0,    77,     0,   375,     0,
2478        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2479        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2480        0,    75,    76,     0,     0,    77,     0,   476,     0,     0,
2481        0,     0,     0,     0,     0,     0,   171,     0,     0,    75,
2482       76,     0,     0,    77,     0,    78,     0,     0,     0,     0,
2483        0,     0,     0,     0,     0,     0,     0,   172,   173,     0,
2484        0,     0,    75,    76,     0,     0,    77,     0,    78,   174,
2485      175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
2486      185,   186,   187,   188,   189,   190,   191,   192,   193,   194,
2487      195,   196,   197,   198,     0,     0,     0,     0,     0,     0,
2488        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2489        0,     0,     0,     0,   199,   200,   201,     0,     0,   202,
2490      203,   204,   205,   206,   207,   208,   209,   210,   211,   212,
2491      213,   214,   215,   216,   217,   218,   219,   220,   221,   222,
2492      223
2493 };
2494
2495 static const yytype_int16 yycheck[] =
2496 {
2497        0,    27,   164,   128,   242,     0,   176,   269,   270,    11,
2498       21,   454,   201,    11,     4,    55,    28,    17,    29,   165,
2499       55,    55,    17,   197,   469,   320,    55,   216,   217,   218,
2500      219,   220,    55,    34,   198,   121,   177,   226,    55,    42,
2501       43,    44,    45,    46,    47,    48,    49,    11,    51,   442,
2502      443,   658,    78,    54,    53,   159,    19,    18,   159,    22,
2503       11,    24,   166,   149,    55,   158,    55,   168,   159,    68,
2504      159,   678,   159,    59,   154,    20,   102,   168,    23,   168,
2505      106,   168,    55,   257,   164,   259,   112,   228,    32,    33,
2506       54,    54,   118,    93,   258,   159,   260,   243,   244,    41,
2507       42,    55,   128,    54,   168,    11,    48,    46,   159,    48,
2508      158,    17,    54,   375,   140,   141,   156,   168,   144,   158,
2509       34,   156,   156,    35,   150,    37,   166,   156,   162,   164,
2510      159,   160,     0,   156,   396,   397,   398,   580,   159,   156,
2511      533,    21,   159,   160,   158,   166,   591,   162,   174,   338,
2512      153,   154,   155,   598,   599,   167,    38,   168,   121,   122,
2513      117,   118,   164,   288,   158,   156,   164,   156,   157,   160,
2514       22,   614,   167,   199,   200,   201,   202,   167,   141,   142,
2515       22,   144,   145,   156,   147,   148,   149,   160,    22,   215,
2516      216,   217,   218,   219,   220,   221,   222,   223,   224,   225,
2517      226,   281,   156,   157,   284,   285,    22,   287,   234,   156,
2518       42,   336,    44,   508,   476,   404,     4,   662,   663,   245,
2519      665,   666,   153,   154,   155,   159,     4,   141,   142,   143,
2520      164,   420,   146,   422,   423,   424,   150,   151,    37,   157,
2521      159,   159,   322,   688,   689,   164,    54,   157,   163,   159,
2522      330,   331,   332,   333,   334,   550,   163,   552,   159,   141,
2523      142,   143,   288,   164,   146,   141,   142,   143,   150,   151,
2524      146,   114,   115,   299,   150,   151,   157,   156,   159,   365,
2525      366,   367,   368,   369,   370,   371,     3,     4,     5,     6,
2526      316,   317,   318,   160,   380,   381,   382,   459,   536,     3,
2527        4,     5,     6,    42,    43,    44,    26,    27,    47,     4,
2528      336,   337,   338,   121,   122,    62,    63,    64,    65,    66,
2529       67,   616,    26,    27,   157,    22,   159,   157,   408,   409,
2530      410,   411,   412,   141,   142,   159,   144,   145,   418,   147,
2531      148,   149,    19,   166,   157,    22,   159,    24,     4,   375,
2532      157,   431,   432,    84,    85,   156,     9,     9,   384,   445,
2533      446,   447,   448,     9,   553,     9,     9,   556,   557,   558,
2534      456,     9,    55,    57,    11,   166,   157,   156,   404,   459,
2535      100,   101,   102,   103,   104,   105,   106,   107,   108,   109,
2536      110,   111,   112,   113,   420,   421,   422,   423,   424,   156,
2537      638,   156,   156,   156,   430,   643,   156,   156,    22,   489,
2538      156,   491,   156,   156,   494,   156,    38,   159,   444,   159,
2539        4,   159,   159,   159,   504,   505,   159,   159,    38,   156,
2540      156,   156,   518,   519,   520,   521,   159,   523,   156,     7,
2541        8,   527,   528,    61,    22,   159,   159,   162,   159,   159,
2542      476,    19,    20,   159,    22,    23,    24,   159,   284,   285,
2543      159,   287,    38,   543,   544,   635,   546,   547,   548,   549,
2544      159,   159,   159,   159,   554,   166,    22,   503,   159,   159,
2545      159,   159,   562,   509,   570,   571,   572,   573,   568,   659,
2546      159,   157,     0,    17,    17,   156,   322,   159,     4,   159,
2547      159,   159,   159,   529,   330,   331,   332,   333,   334,   535,
2548       18,    19,    20,     4,    22,    23,    24,   159,   159,   545,
2549      159,     4,    30,    31,   159,   159,   156,   553,   159,   609,
2550      556,   557,   558,   159,   534,   621,   159,   623,   624,   565,
2551      159,   166,   159,    22,    52,     4,   159,   159,    56,     4,
2552      166,    54,    60,   159,   157,   159,   636,   637,    94,    95,
2553       96,    97,    98,    99,   100,   101,   102,   103,   159,   157,
2554      157,     3,     4,     5,     6,    22,   656,     9,   159,   162,
2555      166,    54,   408,   409,   410,   411,   412,   164,   157,    17,
2556      157,   157,   418,    25,    26,    27,   157,   157,   157,   164,
2557      157,     4,   682,   683,   152,   431,   432,   687,    40,    41,
2558      690,   156,   156,   639,    22,    17,   696,   159,    17,   699,
2559      159,    17,    73,    17,   131,   629,   131,    59,    93,   629,
2560      131,   112,   592,   234,   106,    17,   245,    90,    57,   565,
2561      449,    -1,    -1,    75,    76,    77,    78,    79,    80,    81,
2562       82,    83,    84,    85,    86,    87,    88,    89,    90,    91,
2563       92,    93,    -1,   489,    -1,   491,    -1,    -1,   494,    -1,
2564       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   504,   505,
2565       -1,    -1,    -1,    -1,    -1,    -1,    -1,   119,   120,   121,
2566      122,   123,   124,   125,   126,   127,   128,   129,   130,   131,
2567       -1,   133,    -1,   135,   136,   137,    -1,   139,   140,    -1,
2568       -1,    -1,    -1,    -1,    -1,    -1,    -1,   543,   544,    -1,
2569      546,   547,   548,   549,    -1,    -1,    -1,    -1,   554,    -1,
2570      162,    -1,    -1,   165,    -1,   167,   562,   169,    -1,    -1,
2571       -1,    -1,   568,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2572       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2573       -1,    -1,    -1,    -1,    -1,     3,     4,     5,     6,     7,
2574        8,     9,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2575       -1,    19,    20,   609,    22,    23,    24,    25,    26,    27,
2576       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2577       -1,    -1,    40,    41,    -1,    -1,    -1,    -1,    -1,    -1,
2578      636,   637,    -1,    -1,    -1,    -1,    54,    -1,    -1,     7,
2579        8,    59,    10,    11,    12,    13,    14,    15,    16,    17,
2580      656,    19,    20,    -1,    22,    23,    24,    75,    76,    77,
2581       78,    79,    80,    81,    82,    83,    84,    85,    86,    87,
2582       88,    89,    90,    91,    92,    93,   682,   683,    -1,    -1,
2583       -1,   687,    50,    -1,   690,    -1,    -1,    -1,    -1,    -1,
2584      696,    -1,    -1,   699,    -1,    -1,    -1,    -1,    -1,    -1,
2585       -1,   119,   120,   121,   122,   123,   124,   125,   126,   127,
2586      128,   129,   130,   131,    -1,   133,    -1,   135,   136,   137,
2587       -1,   139,   140,   141,   142,    -1,   144,   145,    -1,   147,
2588      148,   149,    -1,    -1,    -1,    -1,     3,     4,     5,     6,
2589        7,     8,     9,    -1,   162,    -1,     0,   165,    -1,   167,
2590       -1,   169,    19,    20,    -1,    22,    23,    24,    25,    26,
2591       27,    -1,    -1,    -1,    18,    19,    20,    -1,    22,    23,
2592       24,    -1,    -1,    40,    41,    -1,    30,    31,    -1,    -1,
2593       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    55,    -1,
2594       -1,    -1,    59,   161,   162,    -1,    -1,   165,    52,   167,
2595      168,    -1,    56,    -1,    -1,    -1,    60,    -1,    75,    76,
2596       77,    78,    79,    80,    81,    82,    83,    84,    85,    86,
2597       87,    88,    89,    90,    91,    92,    93,    -1,    -1,    -1,
2598       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2599       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2600       -1,    -1,   119,   120,   121,   122,   123,   124,   125,   126,
2601      127,   128,   129,   130,   131,    -1,   133,    -1,   135,   136,
2602      137,    -1,   139,   140,    -1,    -1,    -1,    -1,    -1,    -1,
2603       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   156,
2604       -1,    -1,    -1,    -1,    -1,   162,    -1,    -1,   165,    -1,
2605      167,    -1,   169,     3,     4,     5,     6,     7,     8,     9,
2606       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    19,
2607       20,    -1,    22,    23,    24,    25,    26,    27,    -1,    -1,
2608       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2609       40,    41,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2610       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    59,
2611       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2612       -1,    -1,    -1,    -1,    -1,    75,    76,    77,    78,    79,
2613       80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
2614       90,    91,    92,    93,    -1,    -1,    -1,    -1,    -1,    -1,
2615       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2616       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   119,
2617      120,   121,   122,   123,   124,   125,   126,   127,   128,   129,
2618      130,   131,    -1,   133,    -1,   135,   136,   137,    -1,   139,
2619      140,     7,     8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2620       -1,    -1,    -1,    19,    20,    -1,    22,    23,    24,    25,
2621       -1,    -1,   162,    -1,    -1,   165,    -1,   167,    -1,   169,
2622       -1,    -1,    -1,    -1,    40,    41,    -1,    -1,    -1,    -1,
2623       -1,    -1,    -1,    -1,    -1,    -1,    -1,     7,     8,    55,
2624       10,    11,    12,    13,    14,    15,    16,    17,    -1,    19,
2625       20,    -1,    22,    23,    24,    -1,    -1,    -1,    -1,    75,
2626       76,    77,    78,    79,    80,    81,    82,    83,    84,    85,
2627       86,    87,    88,    89,    90,    91,    92,    93,    -1,    -1,
2628       50,    -1,     7,     8,    -1,    10,    11,    12,    13,    14,
2629       15,    16,    17,    -1,    19,    20,    -1,    22,    23,    24,
2630       -1,    -1,    -1,   119,   120,   121,   122,   123,   124,   125,
2631      126,   127,   128,   129,   130,   131,    -1,   133,    -1,   135,
2632      136,   137,    -1,   139,   140,    50,    -1,    -1,    -1,    -1,
2633       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2634      156,    -1,     7,     8,   160,    -1,   162,    -1,    -1,   165,
2635       -1,   167,    -1,   169,    19,    20,    -1,    22,    23,    24,
2636       25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2637       -1,    -1,    -1,    -1,    -1,    40,    41,    -1,    -1,    -1,
2638       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2639       55,   161,   162,    -1,    -1,   165,    -1,   167,   168,    -1,
2640       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2641       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
2642       85,    86,    87,    88,    89,    90,    91,    92,    93,    -1,
2643       -1,    -1,    -1,    -1,    -1,    -1,   161,   162,    -1,    -1,
2644      165,    -1,   167,   168,    -1,    -1,    -1,    -1,    -1,    -1,
2645       -1,    -1,    -1,    -1,   119,   120,   121,   122,   123,   124,
2646      125,   126,   127,   128,   129,   130,   131,    -1,   133,    -1,
2647      135,   136,   137,    -1,   139,   140,    -1,     7,     8,    -1,
2648       10,    11,    12,    13,    14,    15,    16,    17,    -1,    19,
2649       20,   156,    22,    23,    24,    -1,    -1,   162,    -1,    -1,
2650      165,    -1,   167,    -1,   169,    -1,     7,     8,    -1,    10,
2651       11,    12,    13,    14,    15,    16,    17,    -1,    19,    20,
2652       50,    22,    23,    24,     7,     8,    -1,    10,    11,    12,
2653       13,    14,    15,    16,    17,    -1,    19,    20,    -1,    22,
2654       23,    24,    -1,    -1,    -1,    -1,    -1,     7,     8,    50,
2655       10,    11,    12,    13,    14,    15,    16,    17,    -1,    19,
2656       20,    -1,    22,    23,    24,     7,     8,    50,    10,    11,
2657       12,    13,    14,    15,    16,    17,    -1,    19,    20,    39,
2658       22,    23,    24,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2659       50,    -1,    -1,    -1,    -1,    -1,    -1,     7,     8,    -1,
2660       10,    11,    12,    13,    14,    15,    16,    17,    50,    19,
2661       20,    -1,    22,    23,    24,    -1,    -1,    -1,    -1,    -1,
2662       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    39,
2663       -1,   161,   162,    -1,    -1,   165,    -1,   167,   168,    -1,
2664       50,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2665       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2666      161,   162,    -1,    -1,   165,    -1,   167,   168,    -1,    -1,
2667       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   161,   162,
2668       -1,    -1,   165,   125,   167,   168,    -1,    -1,    -1,    -1,
2669       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2670       -1,   161,   162,    -1,    -1,   165,    -1,   167,    -1,    -1,
2671       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   161,
2672      162,    -1,    -1,   165,    -1,   167,     7,     8,    -1,    10,
2673       11,    12,    13,    14,    15,    16,    17,    -1,    19,    20,
2674       -1,    22,    23,    24,    -1,    -1,    -1,    -1,    -1,    -1,
2675       -1,   161,   162,    -1,    -1,   165,    -1,   167,     7,     8,
2676       -1,    10,    11,    12,    13,    14,    15,    16,    17,    50,
2677       19,    20,    -1,    22,    23,    24,     7,     8,    -1,    10,
2678       11,    12,    13,    14,    15,    16,    17,    -1,    19,    20,
2679       39,    22,    23,    24,    -1,    -1,    -1,    -1,    -1,     7,
2680        8,    50,    10,    11,    12,    13,    14,    15,    16,    17,
2681       -1,    19,    20,    -1,    22,    23,    24,     7,     8,    50,
2682       10,    11,    12,    13,    14,    15,    16,    17,    -1,    19,
2683       20,    39,    22,    23,    24,    -1,    -1,    -1,    -1,    -1,
2684       -1,    -1,    50,    -1,    -1,    -1,     7,     8,    -1,    10,
2685       11,    12,    13,    14,    15,    16,    17,    -1,    19,    20,
2686       50,    22,    23,    24,    -1,    -1,    -1,    -1,    -1,    -1,
2687       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2688      161,   162,    -1,   164,   165,    -1,   167,    -1,    -1,    50,
2689       -1,    -1,     7,     8,    -1,    10,    11,    12,    13,    14,
2690       15,    16,    17,    -1,    19,    20,    -1,    22,    23,    24,
2691       -1,    -1,   161,   162,    -1,    -1,   165,    -1,   167,    -1,
2692       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2693      161,   162,    -1,   164,   165,    50,   167,    -1,    -1,    -1,
2694       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2695       -1,    -1,    -1,   161,   162,    -1,    -1,   165,    -1,   167,
2696       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2697       -1,   161,   162,    -1,    -1,   165,    -1,   167,     7,     8,
2698       -1,    10,    11,    12,    13,    14,    15,    16,    17,    -1,
2699       19,    20,    -1,    22,    23,    24,    -1,    -1,    -1,    -1,
2700      161,   162,    -1,    -1,   165,    -1,   167,    -1,    -1,    -1,
2701        7,     8,    -1,    10,    11,    12,    13,    14,    15,    16,
2702       17,    50,    19,    20,    -1,    22,    23,    24,     7,     8,
2703       -1,    10,    11,    12,    13,    14,    15,    16,    17,    -1,
2704       19,    20,    -1,    22,    23,    24,   161,   162,    -1,    -1,
2705      165,    -1,   167,    50,    -1,    -1,    -1,     7,     8,    -1,
2706       10,    11,    12,    13,    14,    15,    16,    17,    -1,    19,
2707       20,    50,    22,    23,    24,     7,     8,    -1,    10,    11,
2708       12,    13,    14,    15,    16,    17,    -1,    19,    20,    -1,
2709       22,    23,    24,    -1,    -1,    -1,    -1,    -1,     7,     8,
2710       50,    10,    11,    12,    13,    14,    15,    16,    17,    -1,
2711       19,    20,    -1,    22,    23,    24,    -1,    -1,    50,    -1,
2712       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2713       -1,    -1,   161,   162,    -1,    -1,   165,    -1,   167,    -1,
2714       -1,    50,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2715       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2716       -1,    -1,    -1,    -1,   161,   162,    -1,    -1,   165,    -1,
2717      167,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2718       -1,    -1,   161,   162,    -1,    -1,   165,    -1,   167,    -1,
2719       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2720       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2721       -1,   161,   162,    -1,    -1,   165,    -1,   167,    -1,    -1,
2722       -1,    -1,    -1,    -1,    -1,    -1,    36,    -1,    -1,   161,
2723      162,    -1,    -1,   165,    -1,   167,    -1,    -1,    -1,    -1,
2724       -1,    -1,    -1,    -1,    -1,    -1,    -1,    57,    58,    -1,
2725       -1,    -1,   161,   162,    -1,    -1,   165,    -1,   167,    69,
2726       70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
2727       80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
2728       90,    91,    92,    93,    -1,    -1,    -1,    -1,    -1,    -1,
2729       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2730       -1,    -1,    -1,    -1,   114,   115,   116,    -1,    -1,   119,
2731      120,   121,   122,   123,   124,   125,   126,   127,   128,   129,
2732      130,   131,   132,   133,   134,   135,   136,   137,   138,   139,
2733      140
2734 };
2735
2736 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2737    symbol of state STATE-NUM.  */
2738 static const yytype_uint8 yystos[] =
2739 {
2740        0,    19,    20,    22,    23,    24,    30,    31,    52,    56,
2741       60,   178,   181,   182,   183,   184,   216,   217,   218,   220,
2742      219,    53,    68,   225,   158,    59,   158,    18,   158,    42,
2743       43,    44,    45,    46,    47,    48,    49,    51,   153,   154,
2744      155,   185,   186,   187,     0,   218,    46,    48,   188,   235,
2745       42,    43,    44,    47,   189,   232,   234,   242,   158,   158,
2746      162,   226,    22,   224,     7,     8,    10,    11,    12,    13,
2747       14,    15,    16,    17,    50,   161,   162,   165,   167,   178,
2748      182,   203,   204,   238,   187,   187,    35,    37,   214,   187,
2749      187,    21,   243,   244,    29,   168,   233,   243,    22,    22,
2750       22,   227,   156,     4,     4,     4,   167,    10,   168,   204,
2751      209,    55,   156,   180,   214,   214,    42,    44,   190,    32,
2752       33,   213,    62,    63,    64,    65,    66,    67,   191,   230,
2753      230,   181,   247,   159,   164,    39,   204,   205,   207,   208,
2754      163,   163,   168,   209,   159,   168,   156,   208,   160,   213,
2755      213,    10,   125,   204,   206,   215,    11,    12,    13,    14,
2756       15,    16,   176,   177,   204,   210,     4,   206,    28,   167,
2757      231,    36,    57,    58,    69,    70,    71,    72,    73,    74,
2758       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
2759       85,    86,    87,    88,    89,    90,    91,    92,    93,   114,
2760      115,   116,   119,   120,   121,   122,   123,   124,   125,   126,
2761      127,   128,   129,   130,   131,   132,   133,   134,   135,   136,
2762      137,   138,   139,   140,   171,   172,   173,   245,   252,   253,
2763      254,   255,    22,   193,   159,   157,   204,   204,   166,   168,
2764      204,     4,   157,   210,   204,   156,   238,    26,    27,     3,
2765        4,     5,     6,     9,    25,    40,    41,    90,    91,    92,
2766       93,   119,   133,   135,   136,   137,   139,   140,   162,   165,
2767      167,   169,   171,   172,   173,   211,   238,   180,   182,    57,
2768       10,   204,   240,   241,    11,    17,    11,   176,   191,    94,
2769       95,    96,    97,    98,    99,   100,   101,   102,   103,   174,
2770       26,    27,   100,   101,   102,   103,   104,   105,   106,   107,
2771      108,   109,   110,   111,   112,   113,   175,   174,   175,   204,
2772      204,   240,   204,   204,   248,   240,   240,   240,   240,   240,
2773      204,   204,   204,   204,   204,   240,   191,   117,   118,    54,
2774      121,   122,   141,   142,   144,   145,   147,   148,   149,   192,
2775       39,   205,   195,   164,   166,   166,   157,   195,   180,   180,
2776      215,   174,   175,   174,   175,   156,   156,   156,   156,   156,
2777      156,   156,   164,   210,   212,   167,   212,   168,   212,    22,
2778      156,   156,   156,   221,   156,     3,     4,     5,     6,     9,
2779       25,    26,    27,    40,    41,    59,   162,   165,   167,   169,
2780      211,   237,   238,   239,   159,   239,   239,   239,   206,   204,
2781      204,   204,   204,   159,   198,   159,   198,   239,   162,   159,
2782      159,   159,   159,   159,   159,   239,   239,   239,   239,   239,
2783       38,   206,   204,   240,     4,   141,   142,   143,   146,   150,
2784      151,   194,   222,   223,    38,   156,   156,   156,   156,   210,
2785      210,   210,   210,   210,   210,   210,   159,   164,   168,   204,
2786      212,   166,   168,   210,   210,   210,   159,   201,    39,   204,
2787      228,   229,    61,   236,   164,   212,   167,   212,   168,   212,
2788       22,   240,   159,   159,   239,   239,   239,   239,   239,    11,
2789       54,    11,   250,   239,   162,   240,   204,   240,   240,   240,
2790      159,   159,   251,   159,   159,   159,   204,   239,   239,   159,
2791      201,   201,   204,   210,   210,   210,   210,   250,   159,   159,
2792      159,   159,   251,   159,   210,   166,   168,   159,   159,    38,
2793       34,    54,   199,   202,   193,   159,   157,    22,   164,   168,
2794      212,   166,   168,    17,    17,   156,   159,   159,   159,   159,
2795      239,     4,   239,   159,   159,   239,   159,   159,   159,     4,
2796        4,   159,   204,   239,   239,   156,   159,   198,   204,   157,
2797      159,   159,   159,   159,   157,   210,   210,   210,   210,   157,
2798      210,   166,   210,   210,   204,    22,     4,   201,   178,   179,
2799       39,   204,   195,   159,   166,   168,   239,   239,    17,   204,
2800      249,   239,   239,   239,   239,   198,   198,   240,   239,   159,
2801      240,   240,   240,     4,   239,   249,   239,   210,   210,   210,
2802      210,   159,   157,   159,   159,   251,   157,   157,   157,   193,
2803      199,   200,    22,   166,   159,   162,   193,   193,   157,   159,
2804      164,   239,   251,   157,   198,   157,   157,   157,   157,   210,
2805      210,   210,   157,   179,    54,   197,    17,   164,   176,   246,
2806      121,   122,   239,   239,   195,    17,   204,   164,   195,   157,
2807      157,   157,     4,   152,   196,   239,   237,   164,   176,   193,
2808      193,    38,   193,   193,    22,   159,   237,    17,   239,   239,
2809       17,   159,   239,   193,   193,   239,    17,    73,   239,    17,
2810      239
2811 };
2812
2813 #define yyerrok         (yyerrstatus = 0)
2814 #define yyclearin       (yychar = YYEMPTY)
2815 #define YYEMPTY         (-2)
2816 #define YYEOF           0
2817
2818 #define YYACCEPT        goto yyacceptlab
2819 #define YYABORT         goto yyabortlab
2820 #define YYERROR         goto yyerrorlab
2821
2822
2823 /* Like YYERROR except do call yyerror.  This remains here temporarily
2824    to ease the transition to the new meaning of YYERROR, for GCC.
2825    Once GCC version 2 has supplanted version 1, this can go.  */
2826
2827 #define YYFAIL          goto yyerrlab
2828
2829 #define YYRECOVERING()  (!!yyerrstatus)
2830
2831 #define YYBACKUP(Token, Value)                                  \
2832 do                                                              \
2833   if (yychar == YYEMPTY && yylen == 1)                          \
2834     {                                                           \
2835       yychar = (Token);                                         \
2836       yylval = (Value);                                         \
2837       yytoken = YYTRANSLATE (yychar);                           \
2838       YYPOPSTACK (1);                                           \
2839       goto yybackup;                                            \
2840     }                                                           \
2841   else                                                          \
2842     {                                                           \
2843       yyerror (YY_("syntax error: cannot back up")); \
2844       YYERROR;                                                  \
2845     }                                                           \
2846 while (YYID (0))
2847
2848
2849 #define YYTERROR        1
2850 #define YYERRCODE       256
2851
2852
2853 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2854    If N is 0, then set CURRENT to the empty location which ends
2855    the previous symbol: RHS[0] (always defined).  */
2856
2857 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2858 #ifndef YYLLOC_DEFAULT
2859 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
2860     do                                                                  \
2861       if (YYID (N))                                                    \
2862         {                                                               \
2863           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
2864           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
2865           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
2866           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
2867         }                                                               \
2868       else                                                              \
2869         {                                                               \
2870           (Current).first_line   = (Current).last_line   =              \
2871             YYRHSLOC (Rhs, 0).last_line;                                \
2872           (Current).first_column = (Current).last_column =              \
2873             YYRHSLOC (Rhs, 0).last_column;                              \
2874         }                                                               \
2875     while (YYID (0))
2876 #endif
2877
2878
2879 /* YY_LOCATION_PRINT -- Print the location on the stream.
2880    This macro was not mandated originally: define only if we know
2881    we won't break user code: when these are the locations we know.  */
2882
2883 #ifndef YY_LOCATION_PRINT
2884 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2885 #  define YY_LOCATION_PRINT(File, Loc)                  \
2886      fprintf (File, "%d.%d-%d.%d",                      \
2887               (Loc).first_line, (Loc).first_column,     \
2888               (Loc).last_line,  (Loc).last_column)
2889 # else
2890 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2891 # endif
2892 #endif
2893
2894
2895 /* YYLEX -- calling `yylex' with the right arguments.  */
2896
2897 #ifdef YYLEX_PARAM
2898 # define YYLEX yylex (YYLEX_PARAM)
2899 #else
2900 # define YYLEX yylex ()
2901 #endif
2902
2903 /* Enable debugging if requested.  */
2904 #if YYDEBUG
2905
2906 # ifndef YYFPRINTF
2907 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2908 #  define YYFPRINTF fprintf
2909 # endif
2910
2911 # define YYDPRINTF(Args)                        \
2912 do {                                            \
2913   if (yydebug)                                  \
2914     YYFPRINTF Args;                             \
2915 } while (YYID (0))
2916
2917 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
2918 do {                                                                      \
2919   if (yydebug)                                                            \
2920     {                                                                     \
2921       YYFPRINTF (stderr, "%s ", Title);                                   \
2922       yy_symbol_print (stderr,                                            \
2923                   Type, Value); \
2924       YYFPRINTF (stderr, "\n");                                           \
2925     }                                                                     \
2926 } while (YYID (0))
2927
2928
2929 /*--------------------------------.
2930 | Print this symbol on YYOUTPUT.  |
2931 `--------------------------------*/
2932
2933 /*ARGSUSED*/
2934 #if (defined __STDC__ || defined __C99__FUNC__ \
2935      || defined __cplusplus || defined _MSC_VER)
2936 static void
2937 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2938 #else
2939 static void
2940 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2941     FILE *yyoutput;
2942     int yytype;
2943     YYSTYPE const * const yyvaluep;
2944 #endif
2945 {
2946   if (!yyvaluep)
2947     return;
2948 # ifdef YYPRINT
2949   if (yytype < YYNTOKENS)
2950     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2951 # else
2952   YYUSE (yyoutput);
2953 # endif
2954   switch (yytype)
2955     {
2956       default:
2957         break;
2958     }
2959 }
2960
2961
2962 /*--------------------------------.
2963 | Print this symbol on YYOUTPUT.  |
2964 `--------------------------------*/
2965
2966 #if (defined __STDC__ || defined __C99__FUNC__ \
2967      || defined __cplusplus || defined _MSC_VER)
2968 static void
2969 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2970 #else
2971 static void
2972 yy_symbol_print (yyoutput, yytype, yyvaluep)
2973     FILE *yyoutput;
2974     int yytype;
2975     YYSTYPE const * const yyvaluep;
2976 #endif
2977 {
2978   if (yytype < YYNTOKENS)
2979     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2980   else
2981     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2982
2983   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2984   YYFPRINTF (yyoutput, ")");
2985 }
2986
2987 /*------------------------------------------------------------------.
2988 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2989 | TOP (included).                                                   |
2990 `------------------------------------------------------------------*/
2991
2992 #if (defined __STDC__ || defined __C99__FUNC__ \
2993      || defined __cplusplus || defined _MSC_VER)
2994 static void
2995 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2996 #else
2997 static void
2998 yy_stack_print (bottom, top)
2999     yytype_int16 *bottom;
3000     yytype_int16 *top;
3001 #endif
3002 {
3003   YYFPRINTF (stderr, "Stack now");
3004   for (; bottom <= top; ++bottom)
3005     YYFPRINTF (stderr, " %d", *bottom);
3006   YYFPRINTF (stderr, "\n");
3007 }
3008
3009 # define YY_STACK_PRINT(Bottom, Top)                            \
3010 do {                                                            \
3011   if (yydebug)                                                  \
3012     yy_stack_print ((Bottom), (Top));                           \
3013 } while (YYID (0))
3014
3015
3016 /*------------------------------------------------.
3017 | Report that the YYRULE is going to be reduced.  |
3018 `------------------------------------------------*/
3019
3020 #if (defined __STDC__ || defined __C99__FUNC__ \
3021      || defined __cplusplus || defined _MSC_VER)
3022 static void
3023 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3024 #else
3025 static void
3026 yy_reduce_print (yyvsp, yyrule)
3027     YYSTYPE *yyvsp;
3028     int yyrule;
3029 #endif
3030 {
3031   int yynrhs = yyr2[yyrule];
3032   int yyi;
3033   unsigned long int yylno = yyrline[yyrule];
3034   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3035              yyrule - 1, yylno);
3036   /* The symbols being reduced.  */
3037   for (yyi = 0; yyi < yynrhs; yyi++)
3038     {
3039       fprintf (stderr, "   $%d = ", yyi + 1);
3040       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3041                        &(yyvsp[(yyi + 1) - (yynrhs)])
3042                                        );
3043       fprintf (stderr, "\n");
3044     }
3045 }
3046
3047 # define YY_REDUCE_PRINT(Rule)          \
3048 do {                                    \
3049   if (yydebug)                          \
3050     yy_reduce_print (yyvsp, Rule); \
3051 } while (YYID (0))
3052
3053 /* Nonzero means print parse trace.  It is left uninitialized so that
3054    multiple parsers can coexist.  */
3055 int yydebug;
3056 #else /* !YYDEBUG */
3057 # define YYDPRINTF(Args)
3058 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3059 # define YY_STACK_PRINT(Bottom, Top)
3060 # define YY_REDUCE_PRINT(Rule)
3061 #endif /* !YYDEBUG */
3062
3063
3064 /* YYINITDEPTH -- initial size of the parser's stacks.  */
3065 #ifndef YYINITDEPTH
3066 # define YYINITDEPTH 200
3067 #endif
3068
3069 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3070    if the built-in stack extension method is used).
3071
3072    Do not make this value too large; the results are undefined if
3073    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3074    evaluated with infinite-precision integer arithmetic.  */
3075
3076 #ifndef YYMAXDEPTH
3077 # define YYMAXDEPTH 10000
3078 #endif
3079
3080 \f
3081
3082 #if YYERROR_VERBOSE
3083
3084 # ifndef yystrlen
3085 #  if defined __GLIBC__ && defined _STRING_H
3086 #   define yystrlen strlen
3087 #  else
3088 /* Return the length of YYSTR.  */
3089 #if (defined __STDC__ || defined __C99__FUNC__ \
3090      || defined __cplusplus || defined _MSC_VER)
3091 static YYSIZE_T
3092 yystrlen (const char *yystr)
3093 #else
3094 static YYSIZE_T
3095 yystrlen (yystr)
3096     const char *yystr;
3097 #endif
3098 {
3099   YYSIZE_T yylen;
3100   for (yylen = 0; yystr[yylen]; yylen++)
3101     continue;
3102   return yylen;
3103 }
3104 #  endif
3105 # endif
3106
3107 # ifndef yystpcpy
3108 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3109 #   define yystpcpy stpcpy
3110 #  else
3111 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3112    YYDEST.  */
3113 #if (defined __STDC__ || defined __C99__FUNC__ \
3114      || defined __cplusplus || defined _MSC_VER)
3115 static char *
3116 yystpcpy (char *yydest, const char *yysrc)
3117 #else
3118 static char *
3119 yystpcpy (yydest, yysrc)
3120     char *yydest;
3121     const char *yysrc;
3122 #endif
3123 {
3124   char *yyd = yydest;
3125   const char *yys = yysrc;
3126
3127   while ((*yyd++ = *yys++) != '\0')
3128     continue;
3129
3130   return yyd - 1;
3131 }
3132 #  endif
3133 # endif
3134
3135 # ifndef yytnamerr
3136 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3137    quotes and backslashes, so that it's suitable for yyerror.  The
3138    heuristic is that double-quoting is unnecessary unless the string
3139    contains an apostrophe, a comma, or backslash (other than
3140    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
3141    null, do not copy; instead, return the length of what the result
3142    would have been.  */
3143 static YYSIZE_T
3144 yytnamerr (char *yyres, const char *yystr)
3145 {
3146   if (*yystr == '"')
3147     {
3148       YYSIZE_T yyn = 0;
3149       char const *yyp = yystr;
3150
3151       for (;;)
3152         switch (*++yyp)
3153           {
3154           case '\'':
3155           case ',':
3156             goto do_not_strip_quotes;
3157
3158           case '\\':
3159             if (*++yyp != '\\')
3160               goto do_not_strip_quotes;
3161             /* Fall through.  */
3162           default:
3163             if (yyres)
3164               yyres[yyn] = *yyp;
3165             yyn++;
3166             break;
3167
3168           case '"':
3169             if (yyres)
3170               yyres[yyn] = '\0';
3171             return yyn;
3172           }
3173     do_not_strip_quotes: ;
3174     }
3175
3176   if (! yyres)
3177     return yystrlen (yystr);
3178
3179   return yystpcpy (yyres, yystr) - yyres;
3180 }
3181 # endif
3182
3183 /* Copy into YYRESULT an error message about the unexpected token
3184    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
3185    including the terminating null byte.  If YYRESULT is null, do not
3186    copy anything; just return the number of bytes that would be
3187    copied.  As a special case, return 0 if an ordinary "syntax error"
3188    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
3189    size calculation.  */
3190 static YYSIZE_T
3191 yysyntax_error (char *yyresult, int yystate, int yychar)
3192 {
3193   int yyn = yypact[yystate];
3194
3195   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3196     return 0;
3197   else
3198     {
3199       int yytype = YYTRANSLATE (yychar);
3200       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3201       YYSIZE_T yysize = yysize0;
3202       YYSIZE_T yysize1;
3203       int yysize_overflow = 0;
3204       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3205       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3206       int yyx;
3207
3208 # if 0
3209       /* This is so xgettext sees the translatable formats that are
3210          constructed on the fly.  */
3211       YY_("syntax error, unexpected %s");
3212       YY_("syntax error, unexpected %s, expecting %s");
3213       YY_("syntax error, unexpected %s, expecting %s or %s");
3214       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3215       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3216 # endif
3217       char *yyfmt;
3218       char const *yyf;
3219       static char const yyunexpected[] = "syntax error, unexpected %s";
3220       static char const yyexpecting[] = ", expecting %s";
3221       static char const yyor[] = " or %s";
3222       char yyformat[sizeof yyunexpected
3223                     + sizeof yyexpecting - 1
3224                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3225                        * (sizeof yyor - 1))];
3226       char const *yyprefix = yyexpecting;
3227
3228       /* Start YYX at -YYN if negative to avoid negative indexes in
3229          YYCHECK.  */
3230       int yyxbegin = yyn < 0 ? -yyn : 0;
3231
3232       /* Stay within bounds of both yycheck and yytname.  */
3233       int yychecklim = YYLAST - yyn + 1;
3234       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3235       int yycount = 1;
3236
3237       yyarg[0] = yytname[yytype];
3238       yyfmt = yystpcpy (yyformat, yyunexpected);
3239
3240       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3241         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3242           {
3243             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3244               {
3245                 yycount = 1;
3246                 yysize = yysize0;
3247                 yyformat[sizeof yyunexpected - 1] = '\0';
3248                 break;
3249               }
3250             yyarg[yycount++] = yytname[yyx];
3251             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3252             yysize_overflow |= (yysize1 < yysize);
3253             yysize = yysize1;
3254             yyfmt = yystpcpy (yyfmt, yyprefix);
3255             yyprefix = yyor;
3256           }
3257
3258       yyf = YY_(yyformat);
3259       yysize1 = yysize + yystrlen (yyf);
3260       yysize_overflow |= (yysize1 < yysize);
3261       yysize = yysize1;
3262
3263       if (yysize_overflow)
3264         return YYSIZE_MAXIMUM;
3265
3266       if (yyresult)
3267         {
3268           /* Avoid sprintf, as that infringes on the user's name space.
3269              Don't have undefined behavior even if the translation
3270              produced a string with the wrong number of "%s"s.  */
3271           char *yyp = yyresult;
3272           int yyi = 0;
3273           while ((*yyp = *yyf) != '\0')
3274             {
3275               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3276                 {
3277                   yyp += yytnamerr (yyp, yyarg[yyi++]);
3278                   yyf += 2;
3279                 }
3280               else
3281                 {
3282                   yyp++;
3283                   yyf++;
3284                 }
3285             }
3286         }
3287       return yysize;
3288     }
3289 }
3290 #endif /* YYERROR_VERBOSE */
3291 \f
3292
3293 /*-----------------------------------------------.
3294 | Release the memory associated to this symbol.  |
3295 `-----------------------------------------------*/
3296
3297 /*ARGSUSED*/
3298 #if (defined __STDC__ || defined __C99__FUNC__ \
3299      || defined __cplusplus || defined _MSC_VER)
3300 static void
3301 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3302 #else
3303 static void
3304 yydestruct (yymsg, yytype, yyvaluep)
3305     const char *yymsg;
3306     int yytype;
3307     YYSTYPE *yyvaluep;
3308 #endif
3309 {
3310   YYUSE (yyvaluep);
3311
3312   if (!yymsg)
3313     yymsg = "Deleting";
3314   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3315
3316   switch (yytype)
3317     {
3318
3319       default:
3320         break;
3321     }
3322 }
3323 \f
3324
3325 /* Prevent warnings from -Wmissing-prototypes.  */
3326
3327 #ifdef YYPARSE_PARAM
3328 #if defined __STDC__ || defined __cplusplus
3329 int yyparse (void *YYPARSE_PARAM);
3330 #else
3331 int yyparse ();
3332 #endif
3333 #else /* ! YYPARSE_PARAM */
3334 #if defined __STDC__ || defined __cplusplus
3335 int yyparse (void);
3336 #else
3337 int yyparse ();
3338 #endif
3339 #endif /* ! YYPARSE_PARAM */
3340
3341
3342
3343 /* The look-ahead symbol.  */
3344 int yychar;
3345
3346 /* The semantic value of the look-ahead symbol.  */
3347 YYSTYPE yylval;
3348
3349 /* Number of syntax errors so far.  */
3350 int yynerrs;
3351
3352
3353
3354 /*----------.
3355 | yyparse.  |
3356 `----------*/
3357
3358 #ifdef YYPARSE_PARAM
3359 #if (defined __STDC__ || defined __C99__FUNC__ \
3360      || defined __cplusplus || defined _MSC_VER)
3361 int
3362 yyparse (void *YYPARSE_PARAM)
3363 #else
3364 int
3365 yyparse (YYPARSE_PARAM)
3366     void *YYPARSE_PARAM;
3367 #endif
3368 #else /* ! YYPARSE_PARAM */
3369 #if (defined __STDC__ || defined __C99__FUNC__ \
3370      || defined __cplusplus || defined _MSC_VER)
3371 int
3372 yyparse (void)
3373 #else
3374 int
3375 yyparse ()
3376
3377 #endif
3378 #endif
3379 {
3380   
3381   int yystate;
3382   int yyn;
3383   int yyresult;
3384   /* Number of tokens to shift before error messages enabled.  */
3385   int yyerrstatus;
3386   /* Look-ahead token as an internal (translated) token number.  */
3387   int yytoken = 0;
3388 #if YYERROR_VERBOSE
3389   /* Buffer for error messages, and its allocated size.  */
3390   char yymsgbuf[128];
3391   char *yymsg = yymsgbuf;
3392   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3393 #endif
3394
3395   /* Three stacks and their tools:
3396      `yyss': related to states,
3397      `yyvs': related to semantic values,
3398      `yyls': related to locations.
3399
3400      Refer to the stacks thru separate pointers, to allow yyoverflow
3401      to reallocate them elsewhere.  */
3402
3403   /* The state stack.  */
3404   yytype_int16 yyssa[YYINITDEPTH];
3405   yytype_int16 *yyss = yyssa;
3406   yytype_int16 *yyssp;
3407
3408   /* The semantic value stack.  */
3409   YYSTYPE yyvsa[YYINITDEPTH];
3410   YYSTYPE *yyvs = yyvsa;
3411   YYSTYPE *yyvsp;
3412
3413
3414
3415 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
3416
3417   YYSIZE_T yystacksize = YYINITDEPTH;
3418
3419   /* The variables used to return semantic value and location from the
3420      action routines.  */
3421   YYSTYPE yyval;
3422
3423
3424   /* The number of symbols on the RHS of the reduced rule.
3425      Keep to zero when no symbol should be popped.  */
3426   int yylen = 0;
3427
3428   YYDPRINTF ((stderr, "Starting parse\n"));
3429
3430   yystate = 0;
3431   yyerrstatus = 0;
3432   yynerrs = 0;
3433   yychar = YYEMPTY;             /* Cause a token to be read.  */
3434
3435   /* Initialize stack pointers.
3436      Waste one element of value and location stack
3437      so that they stay on the same level as the state stack.
3438      The wasted elements are never initialized.  */
3439
3440   yyssp = yyss;
3441   yyvsp = yyvs;
3442
3443   goto yysetstate;
3444
3445 /*------------------------------------------------------------.
3446 | yynewstate -- Push a new state, which is found in yystate.  |
3447 `------------------------------------------------------------*/
3448  yynewstate:
3449   /* In all cases, when you get here, the value and location stacks
3450      have just been pushed.  So pushing a state here evens the stacks.  */
3451   yyssp++;
3452
3453  yysetstate:
3454   *yyssp = yystate;
3455
3456   if (yyss + yystacksize - 1 <= yyssp)
3457     {
3458       /* Get the current used size of the three stacks, in elements.  */
3459       YYSIZE_T yysize = yyssp - yyss + 1;
3460
3461 #ifdef yyoverflow
3462       {
3463         /* Give user a chance to reallocate the stack.  Use copies of
3464            these so that the &'s don't force the real ones into
3465            memory.  */
3466         YYSTYPE *yyvs1 = yyvs;
3467         yytype_int16 *yyss1 = yyss;
3468
3469
3470         /* Each stack pointer address is followed by the size of the
3471            data in use in that stack, in bytes.  This used to be a
3472            conditional around just the two extra args, but that might
3473            be undefined if yyoverflow is a macro.  */
3474         yyoverflow (YY_("memory exhausted"),
3475                     &yyss1, yysize * sizeof (*yyssp),
3476                     &yyvs1, yysize * sizeof (*yyvsp),
3477
3478                     &yystacksize);
3479
3480         yyss = yyss1;
3481         yyvs = yyvs1;
3482       }
3483 #else /* no yyoverflow */
3484 # ifndef YYSTACK_RELOCATE
3485       goto yyexhaustedlab;
3486 # else
3487       /* Extend the stack our own way.  */
3488       if (YYMAXDEPTH <= yystacksize)
3489         goto yyexhaustedlab;
3490       yystacksize *= 2;
3491       if (YYMAXDEPTH < yystacksize)
3492         yystacksize = YYMAXDEPTH;
3493
3494       {
3495         yytype_int16 *yyss1 = yyss;
3496         union yyalloc *yyptr =
3497           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3498         if (! yyptr)
3499           goto yyexhaustedlab;
3500         YYSTACK_RELOCATE (yyss);
3501         YYSTACK_RELOCATE (yyvs);
3502
3503 #  undef YYSTACK_RELOCATE
3504         if (yyss1 != yyssa)
3505           YYSTACK_FREE (yyss1);
3506       }
3507 # endif
3508 #endif /* no yyoverflow */
3509
3510       yyssp = yyss + yysize - 1;
3511       yyvsp = yyvs + yysize - 1;
3512
3513
3514       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3515                   (unsigned long int) yystacksize));
3516
3517       if (yyss + yystacksize - 1 <= yyssp)
3518         YYABORT;
3519     }
3520
3521   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3522
3523   goto yybackup;
3524
3525 /*-----------.
3526 | yybackup.  |
3527 `-----------*/
3528 yybackup:
3529
3530   /* Do appropriate processing given the current state.  Read a
3531      look-ahead token if we need one and don't already have one.  */
3532
3533   /* First try to decide what to do without reference to look-ahead token.  */
3534   yyn = yypact[yystate];
3535   if (yyn == YYPACT_NINF)
3536     goto yydefault;
3537
3538   /* Not known => get a look-ahead token if don't already have one.  */
3539
3540   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
3541   if (yychar == YYEMPTY)
3542     {
3543       YYDPRINTF ((stderr, "Reading a token: "));
3544       yychar = YYLEX;
3545     }
3546
3547   if (yychar <= YYEOF)
3548     {
3549       yychar = yytoken = YYEOF;
3550       YYDPRINTF ((stderr, "Now at end of input.\n"));
3551     }
3552   else
3553     {
3554       yytoken = YYTRANSLATE (yychar);
3555       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3556     }
3557
3558   /* If the proper action on seeing token YYTOKEN is to reduce or to
3559      detect an error, take that action.  */
3560   yyn += yytoken;
3561   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3562     goto yydefault;
3563   yyn = yytable[yyn];
3564   if (yyn <= 0)
3565     {
3566       if (yyn == 0 || yyn == YYTABLE_NINF)
3567         goto yyerrlab;
3568       yyn = -yyn;
3569       goto yyreduce;
3570     }
3571
3572   if (yyn == YYFINAL)
3573     YYACCEPT;
3574
3575   /* Count tokens shifted since error; after three, turn off error
3576      status.  */
3577   if (yyerrstatus)
3578     yyerrstatus--;
3579
3580   /* Shift the look-ahead token.  */
3581   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3582
3583   /* Discard the shifted token unless it is eof.  */
3584   if (yychar != YYEOF)
3585     yychar = YYEMPTY;
3586
3587   yystate = yyn;
3588   *++yyvsp = yylval;
3589
3590   goto yynewstate;
3591
3592
3593 /*-----------------------------------------------------------.
3594 | yydefault -- do the default action for the current state.  |
3595 `-----------------------------------------------------------*/
3596 yydefault:
3597   yyn = yydefact[yystate];
3598   if (yyn == 0)
3599     goto yyerrlab;
3600   goto yyreduce;
3601
3602
3603 /*-----------------------------.
3604 | yyreduce -- Do a reduction.  |
3605 `-----------------------------*/
3606 yyreduce:
3607   /* yyn is the number of a rule to reduce with.  */
3608   yylen = yyr2[yyn];
3609
3610   /* If YYLEN is nonzero, implement the default value of the action:
3611      `$$ = $1'.
3612
3613      Otherwise, the following line sets YYVAL to garbage.
3614      This behavior is undocumented and Bison
3615      users should not rely upon it.  Assigning to YYVAL
3616      unconditionally makes the parser a bit smaller, and it avoids a
3617      GCC warning that YYVAL may be used uninitialized.  */
3618   yyval = yyvsp[1-yylen];
3619
3620
3621   YY_REDUCE_PRINT (yyn);
3622   switch (yyn)
3623     {
3624         case 29:
3625 #line 1138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3626     { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3627     break;
3628
3629   case 30:
3630 #line 1138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3631     { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3632     break;
3633
3634   case 31:
3635 #line 1139 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3636     { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3637     break;
3638
3639   case 32:
3640 #line 1139 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3641     { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3642     break;
3643
3644   case 33:
3645 #line 1140 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3646     { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3647     break;
3648
3649   case 34:
3650 #line 1140 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3651     { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3652     break;
3653
3654   case 35:
3655 #line 1141 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3656     { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3657     break;
3658
3659   case 36:
3660 #line 1141 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3661     { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3662     break;
3663
3664   case 37:
3665 #line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3666     { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3667     break;
3668
3669   case 38:
3670 #line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3671     { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3672     break;
3673
3674   case 39:
3675 #line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3676     { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3677     break;
3678
3679   case 40:
3680 #line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3681     { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3682     break;
3683
3684   case 41:
3685 #line 1147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3686     { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3687     break;
3688
3689   case 42:
3690 #line 1147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3691     { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3692     break;
3693
3694   case 43:
3695 #line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3696     { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3697     break;
3698
3699   case 44:
3700 #line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3701     { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3702     break;
3703
3704   case 45:
3705 #line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3706     { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3707     break;
3708
3709   case 46:
3710 #line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3711     { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3712     break;
3713
3714   case 47:
3715 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3716     { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3717     break;
3718
3719   case 48:
3720 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3721     { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3722     break;
3723
3724   case 49:
3725 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3726     { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3727     break;
3728
3729   case 50:
3730 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3731     { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3732     break;
3733
3734   case 51:
3735 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3736     { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3737     break;
3738
3739   case 52:
3740 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3741     { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3742     break;
3743
3744   case 53:
3745 #line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3746     { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3747     break;
3748
3749   case 54:
3750 #line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3751     { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3752     break;
3753
3754   case 65:
3755 #line 1163 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3756     { (yyval.StrVal) = 0; ;}
3757     break;
3758
3759   case 66:
3760 #line 1165 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3761     { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3762     break;
3763
3764   case 67:
3765 #line 1166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3766     { (yyval.UIntVal)=0; ;}
3767     break;
3768
3769   case 68:
3770 #line 1170 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3771     {
3772     (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3773     CHECK_FOR_ERROR
3774   ;}
3775     break;
3776
3777   case 69:
3778 #line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3779     {
3780     (yyval.StrVal) = 0;
3781     CHECK_FOR_ERROR
3782   ;}
3783     break;
3784
3785   case 73:
3786 #line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3787     {
3788     (yyval.StrVal) = 0;
3789     CHECK_FOR_ERROR
3790   ;}
3791     break;
3792
3793   case 74:
3794 #line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3795     {
3796     (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3797     CHECK_FOR_ERROR
3798   ;}
3799     break;
3800
3801   case 75:
3802 #line 1193 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3803     { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3804     break;
3805
3806   case 76:
3807 #line 1194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3808     { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3809     break;
3810
3811   case 77:
3812 #line 1195 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3813     { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3814     break;
3815
3816   case 78:
3817 #line 1196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3818     { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3819     break;
3820
3821   case 79:
3822 #line 1197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3823     { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3824     break;
3825
3826   case 80:
3827 #line 1198 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3828     { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3829     break;
3830
3831   case 81:
3832 #line 1202 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3833     { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3834     break;
3835
3836   case 82:
3837 #line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3838     { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3839     break;
3840
3841   case 83:
3842 #line 1204 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3843     { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3844     break;
3845
3846   case 84:
3847 #line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3848     { (yyval.Visibility) = GlobalValue::DefaultVisibility;   ;}
3849     break;
3850
3851   case 85:
3852 #line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3853     { (yyval.Visibility) = GlobalValue::DefaultVisibility;   ;}
3854     break;
3855
3856   case 86:
3857 #line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3858     { (yyval.Visibility) = GlobalValue::HiddenVisibility;    ;}
3859     break;
3860
3861   case 87:
3862 #line 1211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3863     { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3864     break;
3865
3866   case 88:
3867 #line 1215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3868     { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3869     break;
3870
3871   case 89:
3872 #line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3873     { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3874     break;
3875
3876   case 90:
3877 #line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3878     { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3879     break;
3880
3881   case 91:
3882 #line 1221 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3883     { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3884     break;
3885
3886   case 92:
3887 #line 1222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3888     { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3889     break;
3890
3891   case 93:
3892 #line 1223 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3893     { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3894     break;
3895
3896   case 94:
3897 #line 1224 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3898     { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3899     break;
3900
3901   case 95:
3902 #line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3903     { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3904     break;
3905
3906   case 96:
3907 #line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3908     { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3909     break;
3910
3911   case 97:
3912 #line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3913     { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3914     break;
3915
3916   case 98:
3917 #line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3918     { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3919     break;
3920
3921   case 99:
3922 #line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3923     { (yyval.UIntVal) = CallingConv::C; ;}
3924     break;
3925
3926   case 100:
3927 #line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3928     { (yyval.UIntVal) = CallingConv::C; ;}
3929     break;
3930
3931   case 101:
3932 #line 1236 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3933     { (yyval.UIntVal) = CallingConv::Fast; ;}
3934     break;
3935
3936   case 102:
3937 #line 1237 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3938     { (yyval.UIntVal) = CallingConv::Cold; ;}
3939     break;
3940
3941   case 103:
3942 #line 1238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3943     { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3944     break;
3945
3946   case 104:
3947 #line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3948     { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3949     break;
3950
3951   case 105:
3952 #line 1240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3953     {
3954                    if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3955                      GEN_ERROR("Calling conv too large");
3956                    (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3957                   CHECK_FOR_ERROR
3958                  ;}
3959     break;
3960
3961   case 106:
3962 #line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3963     { (yyval.ParamAttrs) = ParamAttr::ZExt;      ;}
3964     break;
3965
3966   case 107:
3967 #line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3968     { (yyval.ParamAttrs) = ParamAttr::ZExt;      ;}
3969     break;
3970
3971   case 108:
3972 #line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3973     { (yyval.ParamAttrs) = ParamAttr::SExt;      ;}
3974     break;
3975
3976   case 109:
3977 #line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3978     { (yyval.ParamAttrs) = ParamAttr::SExt;      ;}
3979     break;
3980
3981   case 110:
3982 #line 1251 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3983     { (yyval.ParamAttrs) = ParamAttr::InReg;     ;}
3984     break;
3985
3986   case 111:
3987 #line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3988     { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
3989     break;
3990
3991   case 112:
3992 #line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3993     { (yyval.ParamAttrs) = ParamAttr::NoAlias;   ;}
3994     break;
3995
3996   case 113:
3997 #line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3998     { (yyval.ParamAttrs) = ParamAttr::ByVal;     ;}
3999     break;
4000
4001   case 114:
4002 #line 1255 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4003     { (yyval.ParamAttrs) = ParamAttr::Nest;      ;}
4004     break;
4005
4006   case 115:
4007 #line 1256 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4008     { (yyval.ParamAttrs) = 
4009                           ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val));    ;}
4010     break;
4011
4012   case 116:
4013 #line 1260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4014     { (yyval.ParamAttrs) = ParamAttr::None; ;}
4015     break;
4016
4017   case 117:
4018 #line 1261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4019     {
4020                 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4021               ;}
4022     break;
4023
4024   case 118:
4025 #line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4026     { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
4027     break;
4028
4029   case 119:
4030 #line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4031     { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
4032     break;
4033
4034   case 120:
4035 #line 1268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4036     { (yyval.ParamAttrs) = ParamAttr::ZExt;     ;}
4037     break;
4038
4039   case 121:
4040 #line 1269 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4041     { (yyval.ParamAttrs) = ParamAttr::SExt;     ;}
4042     break;
4043
4044   case 122:
4045 #line 1270 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4046     { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
4047     break;
4048
4049   case 123:
4050 #line 1271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4051     { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
4052     break;
4053
4054   case 124:
4055 #line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4056     { (yyval.ParamAttrs) = ParamAttr::None; ;}
4057     break;
4058
4059   case 125:
4060 #line 1275 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4061     {
4062                 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4063               ;}
4064     break;
4065
4066   case 126:
4067 #line 1280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4068     { (yyval.StrVal) = 0; ;}
4069     break;
4070
4071   case 127:
4072 #line 1281 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4073     {
4074                 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4075               ;}
4076     break;
4077
4078   case 128:
4079 #line 1288 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4080     { (yyval.UIntVal) = 0; ;}
4081     break;
4082
4083   case 129:
4084 #line 1289 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4085     {
4086   (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4087   if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4088     GEN_ERROR("Alignment must be a power of two");
4089   CHECK_FOR_ERROR
4090 ;}
4091     break;
4092
4093   case 130:
4094 #line 1295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4095     { (yyval.UIntVal) = 0; ;}
4096     break;
4097
4098   case 131:
4099 #line 1296 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4100     {
4101   (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4102   if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4103     GEN_ERROR("Alignment must be a power of two");
4104   CHECK_FOR_ERROR
4105 ;}
4106     break;
4107
4108   case 132:
4109 #line 1305 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4110     {
4111   for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4112     if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4113       GEN_ERROR("Invalid character in section name");
4114   (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4115   CHECK_FOR_ERROR
4116 ;}
4117     break;
4118
4119   case 133:
4120 #line 1313 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4121     { (yyval.StrVal) = 0; ;}
4122     break;
4123
4124   case 134:
4125 #line 1314 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4126     { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4127     break;
4128
4129   case 135:
4130 #line 1319 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4131     {;}
4132     break;
4133
4134   case 136:
4135 #line 1320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4136     {;}
4137     break;
4138
4139   case 137:
4140 #line 1321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4141     {
4142     CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4143     delete (yyvsp[(1) - (1)].StrVal);
4144     CHECK_FOR_ERROR
4145   ;}
4146     break;
4147
4148   case 138:
4149 #line 1326 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4150     {
4151     if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4152       GEN_ERROR("Alignment must be a power of two");
4153     CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4154     CHECK_FOR_ERROR
4155   ;}
4156     break;
4157
4158   case 146:
4159 #line 1342 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4160     {
4161     (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4162     CHECK_FOR_ERROR
4163   ;}
4164     break;
4165
4166   case 147:
4167 #line 1346 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4168     {
4169     (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4170     CHECK_FOR_ERROR
4171   ;}
4172     break;
4173
4174   case 148:
4175 #line 1350 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4176     {                             // Pointer type?
4177     if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4178       GEN_ERROR("Cannot form a pointer to a basic block");
4179     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4180     delete (yyvsp[(1) - (3)].TypeVal);
4181     CHECK_FOR_ERROR
4182   ;}
4183     break;
4184
4185   case 149:
4186 #line 1357 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4187     {            // Named types are also simple types...
4188     const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4189     CHECK_FOR_ERROR
4190     (yyval.TypeVal) = new PATypeHolder(tmp);
4191   ;}
4192     break;
4193
4194   case 150:
4195 #line 1362 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4196     {                   // Type UpReference
4197     if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4198     OpaqueType *OT = OpaqueType::get();        // Use temporary placeholder
4199     UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT));  // Add to vector...
4200     (yyval.TypeVal) = new PATypeHolder(OT);
4201     UR_OUT("New Upreference!\n");
4202     CHECK_FOR_ERROR
4203   ;}
4204     break;
4205
4206   case 151:
4207 #line 1370 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4208     {
4209     // Allow but ignore attributes on function types; this permits auto-upgrade.
4210     // FIXME: remove in LLVM 3.0.
4211     const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4212     if (!FunctionType::isValidReturnType(RetTy))
4213       GEN_ERROR("Invalid result type for LLVM function");
4214       
4215     std::vector<const Type*> Params;
4216     TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4217     for (; I != E; ++I ) {
4218       const Type *Ty = I->Ty->get();
4219       Params.push_back(Ty);
4220     }
4221
4222     bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4223     if (isVarArg) Params.pop_back();
4224
4225     for (unsigned i = 0; i != Params.size(); ++i)
4226       if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4227         GEN_ERROR("Function arguments must be value types!");
4228
4229     CHECK_FOR_ERROR
4230
4231     FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4232     delete (yyvsp[(3) - (5)].TypeWithAttrsList);   // Delete the argument list
4233     delete (yyvsp[(1) - (5)].TypeVal);   // Delete the return type handle
4234     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); 
4235     CHECK_FOR_ERROR
4236   ;}
4237     break;
4238
4239   case 152:
4240 #line 1399 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4241     {
4242     // Allow but ignore attributes on function types; this permits auto-upgrade.
4243     // FIXME: remove in LLVM 3.0.
4244     std::vector<const Type*> Params;
4245     TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4246     for ( ; I != E; ++I ) {
4247       const Type* Ty = I->Ty->get();
4248       Params.push_back(Ty);
4249     }
4250
4251     bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4252     if (isVarArg) Params.pop_back();
4253
4254     for (unsigned i = 0; i != Params.size(); ++i)
4255       if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4256         GEN_ERROR("Function arguments must be value types!");
4257
4258     CHECK_FOR_ERROR
4259
4260     FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4261     delete (yyvsp[(3) - (5)].TypeWithAttrsList);      // Delete the argument list
4262     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); 
4263     CHECK_FOR_ERROR
4264   ;}
4265     break;
4266
4267   case 153:
4268 #line 1424 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4269     {          // Sized array type?
4270     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4271     delete (yyvsp[(4) - (5)].TypeVal);
4272     CHECK_FOR_ERROR
4273   ;}
4274     break;
4275
4276   case 154:
4277 #line 1429 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4278     {          // Vector type?
4279      const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4280      if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4281         GEN_ERROR("Unsigned result not equal to signed result");
4282      if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4283         GEN_ERROR("Element type of a VectorType must be primitive");
4284      (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4285      delete (yyvsp[(4) - (5)].TypeVal);
4286      CHECK_FOR_ERROR
4287   ;}
4288     break;
4289
4290   case 155:
4291 #line 1439 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4292     {                        // Structure type?
4293     std::vector<const Type*> Elements;
4294     for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4295            E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4296       Elements.push_back(*I);
4297
4298     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4299     delete (yyvsp[(2) - (3)].TypeList);
4300     CHECK_FOR_ERROR
4301   ;}
4302     break;
4303
4304   case 156:
4305 #line 1449 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4306     {                                  // Empty structure type?
4307     (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4308     CHECK_FOR_ERROR
4309   ;}
4310     break;
4311
4312   case 157:
4313 #line 1453 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4314     {
4315     std::vector<const Type*> Elements;
4316     for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4317            E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4318       Elements.push_back(*I);
4319
4320     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4321     delete (yyvsp[(3) - (5)].TypeList);
4322     CHECK_FOR_ERROR
4323   ;}
4324     break;
4325
4326   case 158:
4327 #line 1463 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4328     {                         // Empty structure type?
4329     (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4330     CHECK_FOR_ERROR
4331   ;}
4332     break;
4333
4334   case 159:
4335 #line 1470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4336     {
4337     // Allow but ignore attributes on function types; this permits auto-upgrade.
4338     // FIXME: remove in LLVM 3.0.
4339     (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); 
4340     (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4341   ;}
4342     break;
4343
4344   case 160:
4345 #line 1479 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4346     {
4347     if (!UpRefs.empty())
4348       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4349     if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4350       GEN_ERROR("LLVM functions cannot return aggregate types");
4351     (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4352   ;}
4353     break;
4354
4355   case 161:
4356 #line 1486 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4357     {
4358     (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4359   ;}
4360     break;
4361
4362   case 162:
4363 #line 1491 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4364     {
4365     (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4366     (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4367     CHECK_FOR_ERROR
4368   ;}
4369     break;
4370
4371   case 163:
4372 #line 1496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4373     {
4374     ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4375     CHECK_FOR_ERROR
4376   ;}
4377     break;
4378
4379   case 165:
4380 #line 1504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4381     {
4382     (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4383     TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4384     TWA.Ty = new PATypeHolder(Type::VoidTy);
4385     (yyval.TypeWithAttrsList)->push_back(TWA);
4386     CHECK_FOR_ERROR
4387   ;}
4388     break;
4389
4390   case 166:
4391 #line 1511 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4392     {
4393     (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4394     TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4395     TWA.Ty = new PATypeHolder(Type::VoidTy);
4396     (yyval.TypeWithAttrsList)->push_back(TWA);
4397     CHECK_FOR_ERROR
4398   ;}
4399     break;
4400
4401   case 167:
4402 #line 1518 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4403     {
4404     (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4405     CHECK_FOR_ERROR
4406   ;}
4407     break;
4408
4409   case 168:
4410 #line 1526 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4411     {
4412     (yyval.TypeList) = new std::list<PATypeHolder>();
4413     (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); 
4414     delete (yyvsp[(1) - (1)].TypeVal);
4415     CHECK_FOR_ERROR
4416   ;}
4417     break;
4418
4419   case 169:
4420 #line 1532 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4421     {
4422     ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); 
4423     delete (yyvsp[(3) - (3)].TypeVal);
4424     CHECK_FOR_ERROR
4425   ;}
4426     break;
4427
4428   case 170:
4429 #line 1544 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4430     { // Nonempty unsized arr
4431     if (!UpRefs.empty())
4432       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4433     const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4434     if (ATy == 0)
4435       GEN_ERROR("Cannot make array constant with type: '" + 
4436                      (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4437     const Type *ETy = ATy->getElementType();
4438     uint64_t NumElements = ATy->getNumElements();
4439
4440     // Verify that we have the correct size...
4441     if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4442       GEN_ERROR("Type mismatch: constant sized array initialized with " +
4443                      utostr((yyvsp[(3) - (4)].ConstVector)->size()) +  " arguments, but has size of " + 
4444                      utostr(NumElements) + "");
4445
4446     // Verify all elements are correct type!
4447     for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4448       if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4449         GEN_ERROR("Element #" + utostr(i) + " is not of type '" + 
4450                        ETy->getDescription() +"' as required!\nIt is of type '"+
4451                        (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4452     }
4453
4454     (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4455     delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4456     CHECK_FOR_ERROR
4457   ;}
4458     break;
4459
4460   case 171:
4461 #line 1572 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4462     {
4463     if (!UpRefs.empty())
4464       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4465     const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4466     if (ATy == 0)
4467       GEN_ERROR("Cannot make array constant with type: '" + 
4468                      (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4469
4470     uint64_t NumElements = ATy->getNumElements();
4471     if (NumElements != uint64_t(-1) && NumElements != 0) 
4472       GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4473                      " arguments, but has size of " + utostr(NumElements) +"");
4474     (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4475     delete (yyvsp[(1) - (3)].TypeVal);
4476     CHECK_FOR_ERROR
4477   ;}
4478     break;
4479
4480   case 172:
4481 #line 1588 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4482     {
4483     if (!UpRefs.empty())
4484       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4485     const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4486     if (ATy == 0)
4487       GEN_ERROR("Cannot make array constant with type: '" + 
4488                      (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4489
4490     uint64_t NumElements = ATy->getNumElements();
4491     const Type *ETy = ATy->getElementType();
4492     if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4493       GEN_ERROR("Can't build string constant of size " + 
4494                      utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4495                      " when array has size " + utostr(NumElements) + "");
4496     std::vector<Constant*> Vals;
4497     if (ETy == Type::Int8Ty) {
4498       for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4499         Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4500     } else {
4501       delete (yyvsp[(3) - (3)].StrVal);
4502       GEN_ERROR("Cannot build string arrays of non byte sized elements");
4503     }
4504     delete (yyvsp[(3) - (3)].StrVal);
4505     (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4506     delete (yyvsp[(1) - (3)].TypeVal);
4507     CHECK_FOR_ERROR
4508   ;}
4509     break;
4510
4511   case 173:
4512 #line 1615 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4513     { // Nonempty unsized arr
4514     if (!UpRefs.empty())
4515       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4516     const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4517     if (PTy == 0)
4518       GEN_ERROR("Cannot make packed constant with type: '" + 
4519                      (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4520     const Type *ETy = PTy->getElementType();
4521     unsigned NumElements = PTy->getNumElements();
4522
4523     // Verify that we have the correct size...
4524     if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4525       GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4526                      utostr((yyvsp[(3) - (4)].ConstVector)->size()) +  " arguments, but has size of " + 
4527                      utostr(NumElements) + "");
4528
4529     // Verify all elements are correct type!
4530     for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4531       if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4532         GEN_ERROR("Element #" + utostr(i) + " is not of type '" + 
4533            ETy->getDescription() +"' as required!\nIt is of type '"+
4534            (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4535     }
4536
4537     (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4538     delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4539     CHECK_FOR_ERROR
4540   ;}
4541     break;
4542
4543   case 174:
4544 #line 1643 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4545     {
4546     const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4547     if (STy == 0)
4548       GEN_ERROR("Cannot make struct constant with type: '" + 
4549                      (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4550
4551     if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4552       GEN_ERROR("Illegal number of initializers for structure type");
4553
4554     // Check to ensure that constants are compatible with the type initializer!
4555     for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4556       if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4557         GEN_ERROR("Expected type '" +
4558                        STy->getElementType(i)->getDescription() +
4559                        "' for element #" + utostr(i) +
4560                        " of structure initializer");
4561
4562     // Check to ensure that Type is not packed
4563     if (STy->isPacked())
4564       GEN_ERROR("Unpacked Initializer to vector type '" +
4565                 STy->getDescription() + "'");
4566
4567     (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4568     delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4569     CHECK_FOR_ERROR
4570   ;}
4571     break;
4572
4573   case 175:
4574 #line 1669 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4575     {
4576     if (!UpRefs.empty())
4577       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4578     const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4579     if (STy == 0)
4580       GEN_ERROR("Cannot make struct constant with type: '" + 
4581                      (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4582
4583     if (STy->getNumContainedTypes() != 0)
4584       GEN_ERROR("Illegal number of initializers for structure type");
4585
4586     // Check to ensure that Type is not packed
4587     if (STy->isPacked())
4588       GEN_ERROR("Unpacked Initializer to vector type '" +
4589                 STy->getDescription() + "'");
4590
4591     (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4592     delete (yyvsp[(1) - (3)].TypeVal);
4593     CHECK_FOR_ERROR
4594   ;}
4595     break;
4596
4597   case 176:
4598 #line 1689 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4599     {
4600     const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4601     if (STy == 0)
4602       GEN_ERROR("Cannot make struct constant with type: '" + 
4603                      (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4604
4605     if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4606       GEN_ERROR("Illegal number of initializers for structure type");
4607
4608     // Check to ensure that constants are compatible with the type initializer!
4609     for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4610       if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4611         GEN_ERROR("Expected type '" +
4612                        STy->getElementType(i)->getDescription() +
4613                        "' for element #" + utostr(i) +
4614                        " of structure initializer");
4615
4616     // Check to ensure that Type is packed
4617     if (!STy->isPacked())
4618       GEN_ERROR("Vector initializer to non-vector type '" + 
4619                 STy->getDescription() + "'");
4620
4621     (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4622     delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4623     CHECK_FOR_ERROR
4624   ;}
4625     break;
4626
4627   case 177:
4628 #line 1715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4629     {
4630     if (!UpRefs.empty())
4631       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4632     const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4633     if (STy == 0)
4634       GEN_ERROR("Cannot make struct constant with type: '" + 
4635                      (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4636
4637     if (STy->getNumContainedTypes() != 0)
4638       GEN_ERROR("Illegal number of initializers for structure type");
4639
4640     // Check to ensure that Type is packed
4641     if (!STy->isPacked())
4642       GEN_ERROR("Vector initializer to non-vector type '" + 
4643                 STy->getDescription() + "'");
4644
4645     (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4646     delete (yyvsp[(1) - (5)].TypeVal);
4647     CHECK_FOR_ERROR
4648   ;}
4649     break;
4650
4651   case 178:
4652 #line 1735 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4653     {
4654     if (!UpRefs.empty())
4655       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4656     const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4657     if (PTy == 0)
4658       GEN_ERROR("Cannot make null pointer constant with type: '" + 
4659                      (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4660
4661     (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4662     delete (yyvsp[(1) - (2)].TypeVal);
4663     CHECK_FOR_ERROR
4664   ;}
4665     break;
4666
4667   case 179:
4668 #line 1747 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4669     {
4670     if (!UpRefs.empty())
4671       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4672     (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4673     delete (yyvsp[(1) - (2)].TypeVal);
4674     CHECK_FOR_ERROR
4675   ;}
4676     break;
4677
4678   case 180:
4679 #line 1754 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4680     {
4681     if (!UpRefs.empty())
4682       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4683     const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4684     if (Ty == 0)
4685       GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4686
4687     // ConstExprs can exist in the body of a function, thus creating
4688     // GlobalValues whenever they refer to a variable.  Because we are in
4689     // the context of a function, getExistingVal will search the functions
4690     // symbol table instead of the module symbol table for the global symbol,
4691     // which throws things all off.  To get around this, we just tell
4692     // getExistingVal that we are at global scope here.
4693     //
4694     Function *SavedCurFn = CurFun.CurrentFunction;
4695     CurFun.CurrentFunction = 0;
4696
4697     Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4698     CHECK_FOR_ERROR
4699
4700     CurFun.CurrentFunction = SavedCurFn;
4701
4702     // If this is an initializer for a constant pointer, which is referencing a
4703     // (currently) undefined variable, create a stub now that shall be replaced
4704     // in the future with the right type of variable.
4705     //
4706     if (V == 0) {
4707       assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4708       const PointerType *PT = cast<PointerType>(Ty);
4709
4710       // First check to see if the forward references value is already created!
4711       PerModuleInfo::GlobalRefsType::iterator I =
4712         CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4713     
4714       if (I != CurModule.GlobalRefs.end()) {
4715         V = I->second;             // Placeholder already exists, use it...
4716         (yyvsp[(2) - (2)].ValIDVal).destroy();
4717       } else {
4718         std::string Name;
4719         if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4720           Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4721         else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4722           GEN_ERROR("Invalid reference to global");
4723
4724         // Create the forward referenced global.
4725         GlobalValue *GV;
4726         if (const FunctionType *FTy = 
4727                  dyn_cast<FunctionType>(PT->getElementType())) {
4728           GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4729                                 CurModule.CurrentModule);
4730         } else {
4731           GV = new GlobalVariable(PT->getElementType(), false,
4732                                   GlobalValue::ExternalWeakLinkage, 0,
4733                                   Name, CurModule.CurrentModule);
4734         }
4735
4736         // Keep track of the fact that we have a forward ref to recycle it
4737         CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4738         V = GV;
4739       }
4740     }
4741
4742     (yyval.ConstVal) = cast<GlobalValue>(V);
4743     delete (yyvsp[(1) - (2)].TypeVal);            // Free the type handle
4744     CHECK_FOR_ERROR
4745   ;}
4746     break;
4747
4748   case 181:
4749 #line 1820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4750     {
4751     if (!UpRefs.empty())
4752       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4753     if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4754       GEN_ERROR("Mismatched types for constant expression: " + 
4755         (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4756     (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4757     delete (yyvsp[(1) - (2)].TypeVal);
4758     CHECK_FOR_ERROR
4759   ;}
4760     break;
4761
4762   case 182:
4763 #line 1830 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4764     {
4765     if (!UpRefs.empty())
4766       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4767     const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4768     if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4769       GEN_ERROR("Cannot create a null initialized value of this type");
4770     (yyval.ConstVal) = Constant::getNullValue(Ty);
4771     delete (yyvsp[(1) - (2)].TypeVal);
4772     CHECK_FOR_ERROR
4773   ;}
4774     break;
4775
4776   case 183:
4777 #line 1840 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4778     {      // integral constants
4779     if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4780       GEN_ERROR("Constant value doesn't fit in type");
4781     (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4782     CHECK_FOR_ERROR
4783   ;}
4784     break;
4785
4786   case 184:
4787 #line 1846 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4788     {      // arbitrary precision integer constants
4789     uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4790     if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4791       GEN_ERROR("Constant value does not fit in type");
4792     }
4793     (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4794     (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4795     delete (yyvsp[(2) - (2)].APIntVal);
4796     CHECK_FOR_ERROR
4797   ;}
4798     break;
4799
4800   case 185:
4801 #line 1856 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4802     {      // integral constants
4803     if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4804       GEN_ERROR("Constant value doesn't fit in type");
4805     (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4806     CHECK_FOR_ERROR
4807   ;}
4808     break;
4809
4810   case 186:
4811 #line 1862 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4812     {      // arbitrary precision integer constants
4813     uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4814     if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4815       GEN_ERROR("Constant value does not fit in type");
4816     } 
4817     (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4818     (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4819     delete (yyvsp[(2) - (2)].APIntVal);
4820     CHECK_FOR_ERROR
4821   ;}
4822     break;
4823
4824   case 187:
4825 #line 1872 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4826     {                      // Boolean constants
4827     if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4828       GEN_ERROR("Constant true must have type i1");
4829     (yyval.ConstVal) = ConstantInt::getTrue();
4830     CHECK_FOR_ERROR
4831   ;}
4832     break;
4833
4834   case 188:
4835 #line 1878 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4836     {                     // Boolean constants
4837     if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4838       GEN_ERROR("Constant false must have type i1");
4839     (yyval.ConstVal) = ConstantInt::getFalse();
4840     CHECK_FOR_ERROR
4841   ;}
4842     break;
4843
4844   case 189:
4845 #line 1884 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4846     {                   // Floating point constants
4847     if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4848       GEN_ERROR("Floating point constant invalid for type");
4849     // Lexer has no type info, so builds all float and double FP constants 
4850     // as double.  Fix this here.  Long double is done right.
4851     if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4852       (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4853     (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4854     delete (yyvsp[(2) - (2)].FPVal);
4855     CHECK_FOR_ERROR
4856   ;}
4857     break;
4858
4859   case 190:
4860 #line 1897 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4861     {
4862     if (!UpRefs.empty())
4863       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4864     Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4865     const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4866     if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4867       GEN_ERROR("invalid cast opcode for cast from '" +
4868                 Val->getType()->getDescription() + "' to '" +
4869                 DestTy->getDescription() + "'"); 
4870     (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4871     delete (yyvsp[(5) - (6)].TypeVal);
4872   ;}
4873     break;
4874
4875   case 191:
4876 #line 1909 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4877     {
4878     if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4879       GEN_ERROR("GetElementPtr requires a pointer operand");
4880
4881     const Type *IdxTy =
4882       GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4883     if (!IdxTy)
4884       GEN_ERROR("Index list invalid for constant getelementptr");
4885
4886     SmallVector<Constant*, 8> IdxVec;
4887     for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4888       if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4889         IdxVec.push_back(C);
4890       else
4891         GEN_ERROR("Indices to constant getelementptr must be constants");
4892
4893     delete (yyvsp[(4) - (5)].ValueList);
4894
4895     (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4896     CHECK_FOR_ERROR
4897   ;}
4898     break;
4899
4900   case 192:
4901 #line 1930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4902     {
4903     if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4904       GEN_ERROR("Select condition must be of boolean type");
4905     if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4906       GEN_ERROR("Select operand types must match");
4907     (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4908     CHECK_FOR_ERROR
4909   ;}
4910     break;
4911
4912   case 193:
4913 #line 1938 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4914     {
4915     if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4916       GEN_ERROR("Binary operator types must match");
4917     CHECK_FOR_ERROR;
4918     (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4919   ;}
4920     break;
4921
4922   case 194:
4923 #line 1944 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4924     {
4925     if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4926       GEN_ERROR("Logical operator types must match");
4927     if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4928       if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) || 
4929           !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4930         GEN_ERROR("Logical operator requires integral operands");
4931     }
4932     (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4933     CHECK_FOR_ERROR
4934   ;}
4935     break;
4936
4937   case 195:
4938 #line 1955 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4939     {
4940     if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4941       GEN_ERROR("icmp operand types must match");
4942     (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4943   ;}
4944     break;
4945
4946   case 196:
4947 #line 1960 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4948     {
4949     if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4950       GEN_ERROR("fcmp operand types must match");
4951     (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4952   ;}
4953     break;
4954
4955   case 197:
4956 #line 1965 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4957     {
4958     if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4959       GEN_ERROR("vicmp operand types must match");
4960     (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4961   ;}
4962     break;
4963
4964   case 198:
4965 #line 1970 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4966     {
4967     if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4968       GEN_ERROR("vfcmp operand types must match");
4969     (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4970   ;}
4971     break;
4972
4973   case 199:
4974 #line 1975 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4975     {
4976     if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4977       GEN_ERROR("Invalid extractelement operands");
4978     (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4979     CHECK_FOR_ERROR
4980   ;}
4981     break;
4982
4983   case 200:
4984 #line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4985     {
4986     if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4987       GEN_ERROR("Invalid insertelement operands");
4988     (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4989     CHECK_FOR_ERROR
4990   ;}
4991     break;
4992
4993   case 201:
4994 #line 1987 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4995     {
4996     if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4997       GEN_ERROR("Invalid shufflevector operands");
4998     (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4999     CHECK_FOR_ERROR
5000   ;}
5001     break;
5002
5003   case 202:
5004 #line 1993 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5005     {
5006     if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5007       GEN_ERROR("ExtractValue requires an aggregate operand");
5008
5009     (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5010     delete (yyvsp[(4) - (5)].ConstantList);
5011     CHECK_FOR_ERROR
5012   ;}
5013     break;
5014
5015   case 203:
5016 #line 2001 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5017     {
5018     if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5019       GEN_ERROR("InsertValue requires an aggregate operand");
5020
5021     (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5022     delete (yyvsp[(6) - (7)].ConstantList);
5023     CHECK_FOR_ERROR
5024   ;}
5025     break;
5026
5027   case 204:
5028 #line 2012 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5029     {
5030     ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5031     CHECK_FOR_ERROR
5032   ;}
5033     break;
5034
5035   case 205:
5036 #line 2016 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5037     {
5038     (yyval.ConstVector) = new std::vector<Constant*>();
5039     (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5040     CHECK_FOR_ERROR
5041   ;}
5042     break;
5043
5044   case 206:
5045 #line 2024 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5046     { (yyval.BoolVal) = false; ;}
5047     break;
5048
5049   case 207:
5050 #line 2024 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5051     { (yyval.BoolVal) = true; ;}
5052     break;
5053
5054   case 208:
5055 #line 2027 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5056     { (yyval.BoolVal) = true; ;}
5057     break;
5058
5059   case 209:
5060 #line 2027 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5061     { (yyval.BoolVal) = false; ;}
5062     break;
5063
5064   case 210:
5065 #line 2030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5066     {
5067     const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5068     Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5069     CHECK_FOR_ERROR
5070     GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5071     if (!Aliasee)
5072       GEN_ERROR("Aliases can be created only to global values");
5073
5074     (yyval.ConstVal) = Aliasee;
5075     CHECK_FOR_ERROR
5076     delete (yyvsp[(1) - (2)].TypeVal);
5077    ;}
5078     break;
5079
5080   case 211:
5081 #line 2042 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5082     {
5083     Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5084     const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5085     if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5086       GEN_ERROR("invalid cast opcode for cast from '" +
5087                 Val->getType()->getDescription() + "' to '" +
5088                 DestTy->getDescription() + "'");
5089     
5090     (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5091     CHECK_FOR_ERROR
5092     delete (yyvsp[(5) - (6)].TypeVal);
5093    ;}
5094     break;
5095
5096   case 212:
5097 #line 2063 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5098     {
5099     (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5100     CurModule.ModuleDone();
5101     CHECK_FOR_ERROR;
5102   ;}
5103     break;
5104
5105   case 213:
5106 #line 2068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5107     {
5108     (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5109     CurModule.ModuleDone();
5110     CHECK_FOR_ERROR;
5111   ;}
5112     break;
5113
5114   case 216:
5115 #line 2081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5116     { CurFun.isDeclare = false; ;}
5117     break;
5118
5119   case 217:
5120 #line 2081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5121     {
5122     CurFun.FunctionDone();
5123     CHECK_FOR_ERROR
5124   ;}
5125     break;
5126
5127   case 218:
5128 #line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5129     { CurFun.isDeclare = true; ;}
5130     break;
5131
5132   case 219:
5133 #line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5134     {
5135     CHECK_FOR_ERROR
5136   ;}
5137     break;
5138
5139   case 220:
5140 #line 2088 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5141     {
5142     CHECK_FOR_ERROR
5143   ;}
5144     break;
5145
5146   case 221:
5147 #line 2091 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5148     {
5149     if (!UpRefs.empty())
5150       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5151     // Eagerly resolve types.  This is not an optimization, this is a
5152     // requirement that is due to the fact that we could have this:
5153     //
5154     // %list = type { %list * }
5155     // %list = type { %list * }    ; repeated type decl
5156     //
5157     // If types are not resolved eagerly, then the two types will not be
5158     // determined to be the same type!
5159     //
5160     ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5161
5162     if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5163       CHECK_FOR_ERROR
5164       // If this is a named type that is not a redefinition, add it to the slot
5165       // table.
5166       CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5167     }
5168
5169     delete (yyvsp[(3) - (3)].TypeVal);
5170     CHECK_FOR_ERROR
5171   ;}
5172     break;
5173
5174   case 222:
5175 #line 2115 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5176     {
5177     ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5178
5179     if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5180       CHECK_FOR_ERROR
5181       // If this is a named type that is not a redefinition, add it to the slot
5182       // table.
5183       CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5184     }
5185     CHECK_FOR_ERROR
5186   ;}
5187     break;
5188
5189   case 223:
5190 #line 2127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5191     { 
5192     /* "Externally Visible" Linkage */
5193     if ((yyvsp[(5) - (6)].ConstVal) == 0) 
5194       GEN_ERROR("Global value initializer is not a constant");
5195     CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5196                                 (yyvsp[(2) - (6)].Visibility), (yyvsp[(4) - (6)].BoolVal), (yyvsp[(5) - (6)].ConstVal)->getType(), (yyvsp[(5) - (6)].ConstVal), (yyvsp[(3) - (6)].BoolVal), (yyvsp[(6) - (6)].UIntVal));
5197     CHECK_FOR_ERROR
5198   ;}
5199     break;
5200
5201   case 224:
5202 #line 2134 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5203     {
5204     CurGV = 0;
5205   ;}
5206     break;
5207
5208   case 225:
5209 #line 2138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5210     {
5211     if ((yyvsp[(6) - (7)].ConstVal) == 0) 
5212       GEN_ERROR("Global value initializer is not a constant");
5213     CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), (yyvsp[(6) - (7)].ConstVal)->getType(), (yyvsp[(6) - (7)].ConstVal), (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
5214     CHECK_FOR_ERROR
5215   ;}
5216     break;
5217
5218   case 226:
5219 #line 2143 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5220     {
5221     CurGV = 0;
5222   ;}
5223     break;
5224
5225   case 227:
5226 #line 2147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5227     {
5228     if (!UpRefs.empty())
5229       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5230     CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), *(yyvsp[(6) - (7)].TypeVal), 0, (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
5231     CHECK_FOR_ERROR
5232     delete (yyvsp[(6) - (7)].TypeVal);
5233   ;}
5234     break;
5235
5236   case 228:
5237 #line 2153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5238     {
5239     CurGV = 0;
5240     CHECK_FOR_ERROR
5241   ;}
5242     break;
5243
5244   case 229:
5245 #line 2157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5246     {
5247     std::string Name;
5248     if ((yyvsp[(1) - (5)].StrVal)) {
5249       Name = *(yyvsp[(1) - (5)].StrVal);
5250       delete (yyvsp[(1) - (5)].StrVal);
5251     }
5252     if (Name.empty())
5253       GEN_ERROR("Alias name cannot be empty");
5254     
5255     Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5256     if (Aliasee == 0)
5257       GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5258
5259     GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5260                                       CurModule.CurrentModule);
5261     GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5262     InsertValue(GA, CurModule.Values);
5263     
5264     
5265     // If there was a forward reference of this alias, resolve it now.
5266     
5267     ValID ID;
5268     if (!Name.empty())
5269       ID = ValID::createGlobalName(Name);
5270     else
5271       ID = ValID::createGlobalID(CurModule.Values.size()-1);
5272     
5273     if (GlobalValue *FWGV =
5274           CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5275       // Replace uses of the fwdref with the actual alias.
5276       FWGV->replaceAllUsesWith(GA);
5277       if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5278         GV->eraseFromParent();
5279       else
5280         cast<Function>(FWGV)->eraseFromParent();
5281     }
5282     ID.destroy();
5283     
5284     CHECK_FOR_ERROR
5285   ;}
5286     break;
5287
5288   case 230:
5289 #line 2197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5290     { 
5291     CHECK_FOR_ERROR
5292   ;}
5293     break;
5294
5295   case 231:
5296 #line 2200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5297     {
5298     CHECK_FOR_ERROR
5299   ;}
5300     break;
5301
5302   case 232:
5303 #line 2206 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5304     {
5305   const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5306   if (AsmSoFar.empty())
5307     CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5308   else
5309     CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5310   delete (yyvsp[(1) - (1)].StrVal);
5311   CHECK_FOR_ERROR
5312 ;}
5313     break;
5314
5315   case 233:
5316 #line 2216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5317     {
5318     CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5319     delete (yyvsp[(3) - (3)].StrVal);
5320   ;}
5321     break;
5322
5323   case 234:
5324 #line 2220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5325     {
5326     CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5327     delete (yyvsp[(3) - (3)].StrVal);
5328   ;}
5329     break;
5330
5331   case 236:
5332 #line 2227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5333     {
5334           CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5335           delete (yyvsp[(3) - (3)].StrVal);
5336           CHECK_FOR_ERROR
5337         ;}
5338     break;
5339
5340   case 237:
5341 #line 2232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5342     {
5343           CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5344           delete (yyvsp[(1) - (1)].StrVal);
5345           CHECK_FOR_ERROR
5346         ;}
5347     break;
5348
5349   case 238:
5350 #line 2237 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5351     {
5352           CHECK_FOR_ERROR
5353         ;}
5354     break;
5355
5356   case 239:
5357 #line 2246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5358     {
5359     if (!UpRefs.empty())
5360       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5361     if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5362       GEN_ERROR("Argument types must be first-class");
5363     ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5364     (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5365     (yyvsp[(1) - (5)].ArgList)->push_back(E);
5366     CHECK_FOR_ERROR
5367   ;}
5368     break;
5369
5370   case 240:
5371 #line 2256 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5372     {
5373     if (!UpRefs.empty())
5374       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5375     if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5376       GEN_ERROR("Argument types must be first-class");
5377     ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5378     (yyval.ArgList) = new ArgListType;
5379     (yyval.ArgList)->push_back(E);
5380     CHECK_FOR_ERROR
5381   ;}
5382     break;
5383
5384   case 241:
5385 #line 2267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5386     {
5387     (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5388     CHECK_FOR_ERROR
5389   ;}
5390     break;
5391
5392   case 242:
5393 #line 2271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5394     {
5395     (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5396     struct ArgListEntry E;
5397     E.Ty = new PATypeHolder(Type::VoidTy);
5398     E.Name = 0;
5399     E.Attrs = ParamAttr::None;
5400     (yyval.ArgList)->push_back(E);
5401     CHECK_FOR_ERROR
5402   ;}
5403     break;
5404
5405   case 243:
5406 #line 2280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5407     {
5408     (yyval.ArgList) = new ArgListType;
5409     struct ArgListEntry E;
5410     E.Ty = new PATypeHolder(Type::VoidTy);
5411     E.Name = 0;
5412     E.Attrs = ParamAttr::None;
5413     (yyval.ArgList)->push_back(E);
5414     CHECK_FOR_ERROR
5415   ;}
5416     break;
5417
5418   case 244:
5419 #line 2289 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5420     {
5421     (yyval.ArgList) = 0;
5422     CHECK_FOR_ERROR
5423   ;}
5424     break;
5425
5426   case 245:
5427 #line 2295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5428     {
5429   std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5430   delete (yyvsp[(3) - (10)].StrVal);  // Free strdup'd memory!
5431   
5432   // Check the function result for abstractness if this is a define. We should
5433   // have no abstract types at this point
5434   if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5435     GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5436
5437   if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (10)].TypeVal)))
5438     GEN_ERROR("Invalid result type for LLVM function");
5439     
5440   std::vector<const Type*> ParamTypeList;
5441   SmallVector<ParamAttrsWithIndex, 8> Attrs;
5442   if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
5443     Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
5444   if ((yyvsp[(5) - (10)].ArgList)) {   // If there are arguments...
5445     unsigned index = 1;
5446     for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5447       const Type* Ty = I->Ty->get();
5448       if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5449         GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5450       ParamTypeList.push_back(Ty);
5451       if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5452         Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
5453     }
5454   }
5455
5456   bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5457   if (isVarArg) ParamTypeList.pop_back();
5458
5459   PAListPtr PAL;
5460   if (!Attrs.empty())
5461     PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5462
5463   FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5464   const PointerType *PFT = PointerType::getUnqual(FT);
5465   delete (yyvsp[(2) - (10)].TypeVal);
5466
5467   ValID ID;
5468   if (!FunctionName.empty()) {
5469     ID = ValID::createGlobalName((char*)FunctionName.c_str());
5470   } else {
5471     ID = ValID::createGlobalID(CurModule.Values.size());
5472   }
5473
5474   Function *Fn = 0;
5475   // See if this function was forward referenced.  If so, recycle the object.
5476   if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5477     // Move the function to the end of the list, from whereever it was 
5478     // previously inserted.
5479     Fn = cast<Function>(FWRef);
5480     assert(Fn->getParamAttrs().isEmpty() &&
5481            "Forward reference has parameter attributes!");
5482     CurModule.CurrentModule->getFunctionList().remove(Fn);
5483     CurModule.CurrentModule->getFunctionList().push_back(Fn);
5484   } else if (!FunctionName.empty() &&     // Merge with an earlier prototype?
5485              (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5486     if (Fn->getFunctionType() != FT ) {
5487       // The existing function doesn't have the same type. This is an overload
5488       // error.
5489       GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5490     } else if (Fn->getParamAttrs() != PAL) {
5491       // The existing function doesn't have the same parameter attributes.
5492       // This is an overload error.
5493       GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5494     } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5495       // Neither the existing or the current function is a declaration and they
5496       // have the same name and same type. Clearly this is a redefinition.
5497       GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5498     } else if (Fn->isDeclaration()) {
5499       // Make sure to strip off any argument names so we can't get conflicts.
5500       for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5501            AI != AE; ++AI)
5502         AI->setName("");
5503     }
5504   } else  {  // Not already defined?
5505     Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5506                           CurModule.CurrentModule);
5507     InsertValue(Fn, CurModule.Values);
5508   }
5509
5510   CurFun.FunctionStart(Fn);
5511
5512   if (CurFun.isDeclare) {
5513     // If we have declaration, always overwrite linkage.  This will allow us to
5514     // correctly handle cases, when pointer to function is passed as argument to
5515     // another function.
5516     Fn->setLinkage(CurFun.Linkage);
5517     Fn->setVisibility(CurFun.Visibility);
5518   }
5519   Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5520   Fn->setParamAttrs(PAL);
5521   Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5522   if ((yyvsp[(8) - (10)].StrVal)) {
5523     Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5524     delete (yyvsp[(8) - (10)].StrVal);
5525   }
5526   if ((yyvsp[(10) - (10)].StrVal)) {
5527     Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
5528     delete (yyvsp[(10) - (10)].StrVal);
5529   }
5530
5531   // Add all of the arguments we parsed to the function...
5532   if ((yyvsp[(5) - (10)].ArgList)) {                     // Is null if empty...
5533     if (isVarArg) {  // Nuke the last entry
5534       assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5535              "Not a varargs marker!");
5536       delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5537       (yyvsp[(5) - (10)].ArgList)->pop_back();  // Delete the last entry
5538     }
5539     Function::arg_iterator ArgIt = Fn->arg_begin();
5540     Function::arg_iterator ArgEnd = Fn->arg_end();
5541     unsigned Idx = 1;
5542     for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); 
5543          I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5544       delete I->Ty;                          // Delete the typeholder...
5545       setValueName(ArgIt, I->Name);       // Insert arg into symtab...
5546       CHECK_FOR_ERROR
5547       InsertValue(ArgIt);
5548       Idx++;
5549     }
5550
5551     delete (yyvsp[(5) - (10)].ArgList);                     // We're now done with the argument list
5552   }
5553   CHECK_FOR_ERROR
5554 ;}
5555     break;
5556
5557   case 248:
5558 #line 2425 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5559     {
5560   (yyval.FunctionVal) = CurFun.CurrentFunction;
5561
5562   // Make sure that we keep track of the linkage type even if there was a
5563   // previous "declare".
5564   (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5565   (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5566 ;}
5567     break;
5568
5569   case 251:
5570 #line 2436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5571     {
5572   (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5573   CHECK_FOR_ERROR
5574 ;}
5575     break;
5576
5577   case 252:
5578 #line 2441 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5579     {
5580     CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5581     CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5582     (yyval.FunctionVal) = CurFun.CurrentFunction;
5583     CurFun.FunctionDone();
5584     CHECK_FOR_ERROR
5585   ;}
5586     break;
5587
5588   case 253:
5589 #line 2453 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5590     {
5591     (yyval.BoolVal) = false;
5592     CHECK_FOR_ERROR
5593   ;}
5594     break;
5595
5596   case 254:
5597 #line 2457 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5598     {
5599     (yyval.BoolVal) = true;
5600     CHECK_FOR_ERROR
5601   ;}
5602     break;
5603
5604   case 255:
5605 #line 2462 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5606     {    // A reference to a direct constant
5607     (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5608     CHECK_FOR_ERROR
5609   ;}
5610     break;
5611
5612   case 256:
5613 #line 2466 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5614     {
5615     (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5616     CHECK_FOR_ERROR
5617   ;}
5618     break;
5619
5620   case 257:
5621 #line 2470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5622     {      // arbitrary precision integer constants
5623     (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5624     delete (yyvsp[(1) - (1)].APIntVal);
5625     CHECK_FOR_ERROR
5626   ;}
5627     break;
5628
5629   case 258:
5630 #line 2475 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5631     {      // arbitrary precision integer constants
5632     (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5633     delete (yyvsp[(1) - (1)].APIntVal);
5634     CHECK_FOR_ERROR
5635   ;}
5636     break;
5637
5638   case 259:
5639 #line 2480 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5640     {                     // Perhaps it's an FP constant?
5641     (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5642     CHECK_FOR_ERROR
5643   ;}
5644     break;
5645
5646   case 260:
5647 #line 2484 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5648     {
5649     (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5650     CHECK_FOR_ERROR
5651   ;}
5652     break;
5653
5654   case 261:
5655 #line 2488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5656     {
5657     (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5658     CHECK_FOR_ERROR
5659   ;}
5660     break;
5661
5662   case 262:
5663 #line 2492 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5664     {
5665     (yyval.ValIDVal) = ValID::createNull();
5666     CHECK_FOR_ERROR
5667   ;}
5668     break;
5669
5670   case 263:
5671 #line 2496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5672     {
5673     (yyval.ValIDVal) = ValID::createUndef();
5674     CHECK_FOR_ERROR
5675   ;}
5676     break;
5677
5678   case 264:
5679 #line 2500 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5680     {     // A vector zero constant.
5681     (yyval.ValIDVal) = ValID::createZeroInit();
5682     CHECK_FOR_ERROR
5683   ;}
5684     break;
5685
5686   case 265:
5687 #line 2504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5688     { // Nonempty unsized packed vector
5689     const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5690     unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); 
5691
5692     if (!ETy->isInteger() && !ETy->isFloatingPoint())
5693       GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5694     
5695     VectorType* pt = VectorType::get(ETy, NumElements);
5696     PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5697     
5698     // Verify all elements are correct type!
5699     for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5700       if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5701         GEN_ERROR("Element #" + utostr(i) + " is not of type '" + 
5702                      ETy->getDescription() +"' as required!\nIt is of type '" +
5703                      (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5704     }
5705
5706     (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5707     delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5708     CHECK_FOR_ERROR
5709   ;}
5710     break;
5711
5712   case 266:
5713 #line 2526 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5714     { // Nonempty unsized arr
5715     const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5716     uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); 
5717
5718     if (!ETy->isFirstClassType())
5719       GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5720
5721     ArrayType *ATy = ArrayType::get(ETy, NumElements);
5722     PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5723
5724     // Verify all elements are correct type!
5725     for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5726       if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5727         GEN_ERROR("Element #" + utostr(i) + " is not of type '" + 
5728                        ETy->getDescription() +"' as required!\nIt is of type '"+
5729                        (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5730     }
5731
5732     (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5733     delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5734     CHECK_FOR_ERROR
5735   ;}
5736     break;
5737
5738   case 267:
5739 #line 2548 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5740     {
5741     // Use undef instead of an array because it's inconvenient to determine
5742     // the element type at this point, there being no elements to examine.
5743     (yyval.ValIDVal) = ValID::createUndef();
5744     CHECK_FOR_ERROR
5745   ;}
5746     break;
5747
5748   case 268:
5749 #line 2554 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5750     {
5751     uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5752     const Type *ETy = Type::Int8Ty;
5753
5754     ArrayType *ATy = ArrayType::get(ETy, NumElements);
5755
5756     std::vector<Constant*> Vals;
5757     for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5758       Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5759     delete (yyvsp[(2) - (2)].StrVal);
5760     (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5761     CHECK_FOR_ERROR
5762   ;}
5763     break;
5764
5765   case 269:
5766 #line 2567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5767     {
5768     std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5769     for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5770       Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5771
5772     const StructType *STy = StructType::get(Elements);
5773     PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5774
5775     (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5776     delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5777     CHECK_FOR_ERROR
5778   ;}
5779     break;
5780
5781   case 270:
5782 #line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5783     {
5784     const StructType *STy = StructType::get(std::vector<const Type*>());
5785     (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5786     CHECK_FOR_ERROR
5787   ;}
5788     break;
5789
5790   case 271:
5791 #line 2584 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5792     {
5793     std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5794     for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5795       Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5796
5797     const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5798     PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5799
5800     (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5801     delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5802     CHECK_FOR_ERROR
5803   ;}
5804     break;
5805
5806   case 272:
5807 #line 2596 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5808     {
5809     const StructType *STy = StructType::get(std::vector<const Type*>(),
5810                                             /*isPacked=*/true);
5811     (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5812     CHECK_FOR_ERROR
5813   ;}
5814     break;
5815
5816   case 273:
5817 #line 2602 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5818     {
5819     (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5820     CHECK_FOR_ERROR
5821   ;}
5822     break;
5823
5824   case 274:
5825 #line 2606 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5826     {
5827     (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5828     delete (yyvsp[(3) - (5)].StrVal);
5829     delete (yyvsp[(5) - (5)].StrVal);
5830     CHECK_FOR_ERROR
5831   ;}
5832     break;
5833
5834   case 275:
5835 #line 2616 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5836     {  // Is it an integer reference...?
5837     (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5838     CHECK_FOR_ERROR
5839   ;}
5840     break;
5841
5842   case 276:
5843 #line 2620 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5844     {
5845     (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5846     CHECK_FOR_ERROR
5847   ;}
5848     break;
5849
5850   case 277:
5851 #line 2624 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5852     {                   // Is it a named reference...?
5853     (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5854     delete (yyvsp[(1) - (1)].StrVal);
5855     CHECK_FOR_ERROR
5856   ;}
5857     break;
5858
5859   case 278:
5860 #line 2629 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5861     {                   // Is it a named reference...?
5862     (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5863     delete (yyvsp[(1) - (1)].StrVal);
5864     CHECK_FOR_ERROR
5865   ;}
5866     break;
5867
5868   case 281:
5869 #line 2642 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5870     {
5871     if (!UpRefs.empty())
5872       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5873     (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal)); 
5874     delete (yyvsp[(1) - (2)].TypeVal);
5875     CHECK_FOR_ERROR
5876   ;}
5877     break;
5878
5879   case 282:
5880 #line 2651 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5881     {
5882     (yyval.ValueList) = new std::vector<Value *>();
5883     (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); 
5884     CHECK_FOR_ERROR
5885   ;}
5886     break;
5887
5888   case 283:
5889 #line 2656 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5890     {
5891     ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); 
5892     CHECK_FOR_ERROR
5893   ;}
5894     break;
5895
5896   case 284:
5897 #line 2661 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5898     {
5899     (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5900     CHECK_FOR_ERROR
5901   ;}
5902     break;
5903
5904   case 285:
5905 #line 2665 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5906     { // Do not allow functions with 0 basic blocks   
5907     (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5908     CHECK_FOR_ERROR
5909   ;}
5910     break;
5911
5912   case 286:
5913 #line 2674 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5914     {
5915     setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5916     CHECK_FOR_ERROR
5917     InsertValue((yyvsp[(3) - (3)].TermInstVal));
5918     (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5919     (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5920     CHECK_FOR_ERROR
5921   ;}
5922     break;
5923
5924   case 287:
5925 #line 2683 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5926     {
5927     if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5928       if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5929         if (CI2->getParent() == 0)
5930           (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5931     (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5932     (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5933     CHECK_FOR_ERROR
5934   ;}
5935     break;
5936
5937   case 288:
5938 #line 2692 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5939     {          // Empty space between instruction lists
5940     (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5941     CHECK_FOR_ERROR
5942   ;}
5943     break;
5944
5945   case 289:
5946 #line 2696 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5947     {             // Labelled (named) basic block
5948     (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5949     delete (yyvsp[(1) - (1)].StrVal);
5950     CHECK_FOR_ERROR
5951
5952   ;}
5953     break;
5954
5955   case 290:
5956 #line 2704 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5957     { // Return with a result...
5958     ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
5959     assert(!VL.empty() && "Invalid ret operands!");
5960     (yyval.TermInstVal) = ReturnInst::Create(&VL[0], VL.size());
5961     delete (yyvsp[(2) - (2)].ValueList);
5962     CHECK_FOR_ERROR
5963   ;}
5964     break;
5965
5966   case 291:
5967 #line 2711 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5968     {                                    // Return with no result...
5969     (yyval.TermInstVal) = ReturnInst::Create();
5970     CHECK_FOR_ERROR
5971   ;}
5972     break;
5973
5974   case 292:
5975 #line 2715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5976     {                           // Unconditional Branch...
5977     BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
5978     CHECK_FOR_ERROR
5979     (yyval.TermInstVal) = BranchInst::Create(tmpBB);
5980   ;}
5981     break;
5982
5983   case 293:
5984 #line 2720 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5985     {  
5986     if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
5987       GEN_ERROR("Branch condition must have type i1");
5988     BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5989     CHECK_FOR_ERROR
5990     BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
5991     CHECK_FOR_ERROR
5992     Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
5993     CHECK_FOR_ERROR
5994     (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
5995   ;}
5996     break;
5997
5998   case 294:
5999 #line 2731 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6000     {
6001     Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6002     CHECK_FOR_ERROR
6003     BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6004     CHECK_FOR_ERROR
6005     SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6006     (yyval.TermInstVal) = S;
6007
6008     std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6009       E = (yyvsp[(8) - (9)].JumpTable)->end();
6010     for (; I != E; ++I) {
6011       if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6012           S->addCase(CI, I->second);
6013       else
6014         GEN_ERROR("Switch case is constant, but not a simple integer");
6015     }
6016     delete (yyvsp[(8) - (9)].JumpTable);
6017     CHECK_FOR_ERROR
6018   ;}
6019     break;
6020
6021   case 295:
6022 #line 2750 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6023     {
6024     Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6025     CHECK_FOR_ERROR
6026     BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6027     CHECK_FOR_ERROR
6028     SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6029     (yyval.TermInstVal) = S;
6030     CHECK_FOR_ERROR
6031   ;}
6032     break;
6033
6034   case 296:
6035 #line 2760 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6036     {
6037
6038     // Handle the short syntax
6039     const PointerType *PFTy = 0;
6040     const FunctionType *Ty = 0;
6041     if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
6042         !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6043       // Pull out the types of all of the arguments...
6044       std::vector<const Type*> ParamTypes;
6045       ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
6046       for (; I != E; ++I) {
6047         const Type *Ty = I->Val->getType();
6048         if (Ty == Type::VoidTy)
6049           GEN_ERROR("Short call syntax cannot be used with varargs");
6050         ParamTypes.push_back(Ty);
6051       }
6052       
6053       if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
6054         GEN_ERROR("Invalid result type for LLVM function");
6055
6056       Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
6057       PFTy = PointerType::getUnqual(Ty);
6058     }
6059
6060     delete (yyvsp[(3) - (14)].TypeVal);
6061
6062     Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal));   // Get the function we're calling...
6063     CHECK_FOR_ERROR
6064     BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
6065     CHECK_FOR_ERROR
6066     BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
6067     CHECK_FOR_ERROR
6068
6069     SmallVector<ParamAttrsWithIndex, 8> Attrs;
6070     if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
6071       Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
6072
6073     // Check the arguments
6074     ValueList Args;
6075     if ((yyvsp[(6) - (14)].ParamList)->empty()) {                                   // Has no arguments?
6076       // Make sure no arguments is a good thing!
6077       if (Ty->getNumParams() != 0)
6078         GEN_ERROR("No arguments passed to a function that "
6079                        "expects arguments");
6080     } else {                                     // Has arguments?
6081       // Loop through FunctionType's arguments and ensure they are specified
6082       // correctly!
6083       FunctionType::param_iterator I = Ty->param_begin();
6084       FunctionType::param_iterator E = Ty->param_end();
6085       ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
6086       unsigned index = 1;
6087
6088       for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6089         if (ArgI->Val->getType() != *I)
6090           GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6091                          (*I)->getDescription() + "'");
6092         Args.push_back(ArgI->Val);
6093         if (ArgI->Attrs != ParamAttr::None)
6094           Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6095       }
6096
6097       if (Ty->isVarArg()) {
6098         if (I == E)
6099           for (; ArgI != ArgE; ++ArgI, ++index) {
6100             Args.push_back(ArgI->Val); // push the remaining varargs
6101             if (ArgI->Attrs != ParamAttr::None)
6102               Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6103           }
6104       } else if (I != E || ArgI != ArgE)
6105         GEN_ERROR("Invalid number of parameters detected");
6106     }
6107
6108     PAListPtr PAL;
6109     if (!Attrs.empty())
6110       PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6111
6112     // Create the InvokeInst
6113     InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6114                                         Args.begin(), Args.end());
6115     II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
6116     II->setParamAttrs(PAL);
6117     (yyval.TermInstVal) = II;
6118     delete (yyvsp[(6) - (14)].ParamList);
6119     CHECK_FOR_ERROR
6120   ;}
6121     break;
6122
6123   case 297:
6124 #line 2845 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6125     {
6126     (yyval.TermInstVal) = new UnwindInst();
6127     CHECK_FOR_ERROR
6128   ;}
6129     break;
6130
6131   case 298:
6132 #line 2849 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6133     {
6134     (yyval.TermInstVal) = new UnreachableInst();
6135     CHECK_FOR_ERROR
6136   ;}
6137     break;
6138
6139   case 299:
6140 #line 2856 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6141     {
6142     (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6143     Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6144     CHECK_FOR_ERROR
6145     if (V == 0)
6146       GEN_ERROR("May only switch on a constant pool value");
6147
6148     BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6149     CHECK_FOR_ERROR
6150     (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6151   ;}
6152     break;
6153
6154   case 300:
6155 #line 2867 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6156     {
6157     (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6158     Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6159     CHECK_FOR_ERROR
6160
6161     if (V == 0)
6162       GEN_ERROR("May only switch on a constant pool value");
6163
6164     BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6165     CHECK_FOR_ERROR
6166     (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); 
6167   ;}
6168     break;
6169
6170   case 301:
6171 #line 2880 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6172     {
6173     // Is this definition named?? if so, assign the name...
6174     setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6175     CHECK_FOR_ERROR
6176     InsertValue((yyvsp[(2) - (2)].InstVal));
6177     (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6178     CHECK_FOR_ERROR
6179   ;}
6180     break;
6181
6182   case 302:
6183 #line 2890 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6184     {    // Used for PHI nodes
6185     if (!UpRefs.empty())
6186       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6187     (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6188     Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6189     CHECK_FOR_ERROR
6190     BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6191     CHECK_FOR_ERROR
6192     (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6193     delete (yyvsp[(1) - (6)].TypeVal);
6194   ;}
6195     break;
6196
6197   case 303:
6198 #line 2901 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6199     {
6200     (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6201     Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6202     CHECK_FOR_ERROR
6203     BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6204     CHECK_FOR_ERROR
6205     (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6206   ;}
6207     break;
6208
6209   case 304:
6210 #line 2911 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6211     {
6212     // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6213     if (!UpRefs.empty())
6214       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6215     // Used for call and invoke instructions
6216     (yyval.ParamList) = new ParamList();
6217     ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6218     (yyval.ParamList)->push_back(E);
6219     delete (yyvsp[(1) - (4)].TypeVal);
6220     CHECK_FOR_ERROR
6221   ;}
6222     break;
6223
6224   case 305:
6225 #line 2922 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6226     {
6227     // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6228     // Labels are only valid in ASMs
6229     (yyval.ParamList) = new ParamList();
6230     ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6231     (yyval.ParamList)->push_back(E);
6232     CHECK_FOR_ERROR
6233   ;}
6234     break;
6235
6236   case 306:
6237 #line 2930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6238     {
6239     // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6240     if (!UpRefs.empty())
6241       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6242     (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6243     ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6244     (yyval.ParamList)->push_back(E);
6245     delete (yyvsp[(3) - (6)].TypeVal);
6246     CHECK_FOR_ERROR
6247   ;}
6248     break;
6249
6250   case 307:
6251 #line 2940 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6252     {
6253     // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6254     (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6255     ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6256     (yyval.ParamList)->push_back(E);
6257     CHECK_FOR_ERROR
6258   ;}
6259     break;
6260
6261   case 308:
6262 #line 2947 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6263     { (yyval.ParamList) = new ParamList(); ;}
6264     break;
6265
6266   case 309:
6267 #line 2950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6268     { (yyval.ValueList) = new std::vector<Value*>(); ;}
6269     break;
6270
6271   case 310:
6272 #line 2951 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6273     {
6274     (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6275     (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6276     CHECK_FOR_ERROR
6277   ;}
6278     break;
6279
6280   case 311:
6281 #line 2959 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6282     {
6283     (yyval.ConstantList) = new std::vector<unsigned>();
6284     if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6285       GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6286     (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6287   ;}
6288     break;
6289
6290   case 312:
6291 #line 2965 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6292     {
6293     (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6294     if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6295       GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6296     (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6297     CHECK_FOR_ERROR
6298   ;}
6299     break;
6300
6301   case 313:
6302 #line 2974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6303     {
6304     (yyval.BoolVal) = true;
6305     CHECK_FOR_ERROR
6306   ;}
6307     break;
6308
6309   case 314:
6310 #line 2978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6311     {
6312     (yyval.BoolVal) = false;
6313     CHECK_FOR_ERROR
6314   ;}
6315     break;
6316
6317   case 315:
6318 #line 2983 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6319     {
6320     if (!UpRefs.empty())
6321       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6322     if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() && 
6323         !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6324       GEN_ERROR(
6325         "Arithmetic operator requires integer, FP, or packed operands");
6326     Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); 
6327     CHECK_FOR_ERROR
6328     Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6329     CHECK_FOR_ERROR
6330     (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6331     if ((yyval.InstVal) == 0)
6332       GEN_ERROR("binary operator returned null");
6333     delete (yyvsp[(2) - (5)].TypeVal);
6334   ;}
6335     break;
6336
6337   case 316:
6338 #line 2999 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6339     {
6340     if (!UpRefs.empty())
6341       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6342     if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6343       if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6344           !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6345         GEN_ERROR("Logical operator requires integral operands");
6346     }
6347     Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6348     CHECK_FOR_ERROR
6349     Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6350     CHECK_FOR_ERROR
6351     (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6352     if ((yyval.InstVal) == 0)
6353       GEN_ERROR("binary operator returned null");
6354     delete (yyvsp[(2) - (5)].TypeVal);
6355   ;}
6356     break;
6357
6358   case 317:
6359 #line 3016 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6360     {
6361     if (!UpRefs.empty())
6362       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6363     if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6364       GEN_ERROR("Vector types not supported by icmp instruction");
6365     Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6366     CHECK_FOR_ERROR
6367     Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6368     CHECK_FOR_ERROR
6369     (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6370     if ((yyval.InstVal) == 0)
6371       GEN_ERROR("icmp operator returned null");
6372     delete (yyvsp[(3) - (6)].TypeVal);
6373   ;}
6374     break;
6375
6376   case 318:
6377 #line 3030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6378     {
6379     if (!UpRefs.empty())
6380       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6381     if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6382       GEN_ERROR("Vector types not supported by fcmp instruction");
6383     Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6384     CHECK_FOR_ERROR
6385     Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6386     CHECK_FOR_ERROR
6387     (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6388     if ((yyval.InstVal) == 0)
6389       GEN_ERROR("fcmp operator returned null");
6390     delete (yyvsp[(3) - (6)].TypeVal);
6391   ;}
6392     break;
6393
6394   case 319:
6395 #line 3044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6396     {
6397     if (!UpRefs.empty())
6398       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6399     if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6400       GEN_ERROR("Scalar types not supported by vicmp instruction");
6401     Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6402     CHECK_FOR_ERROR
6403     Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6404     CHECK_FOR_ERROR
6405     (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6406     if ((yyval.InstVal) == 0)
6407       GEN_ERROR("icmp operator returned null");
6408     delete (yyvsp[(3) - (6)].TypeVal);
6409   ;}
6410     break;
6411
6412   case 320:
6413 #line 3058 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6414     {
6415     if (!UpRefs.empty())
6416       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6417     if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6418       GEN_ERROR("Scalar types not supported by vfcmp instruction");
6419     Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6420     CHECK_FOR_ERROR
6421     Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6422     CHECK_FOR_ERROR
6423     (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6424     if ((yyval.InstVal) == 0)
6425       GEN_ERROR("fcmp operator returned null");
6426     delete (yyvsp[(3) - (6)].TypeVal);
6427   ;}
6428     break;
6429
6430   case 321:
6431 #line 3072 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6432     {
6433     if (!UpRefs.empty())
6434       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6435     Value* Val = (yyvsp[(2) - (4)].ValueVal);
6436     const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6437     if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6438       GEN_ERROR("invalid cast opcode for cast from '" +
6439                 Val->getType()->getDescription() + "' to '" +
6440                 DestTy->getDescription() + "'"); 
6441     (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6442     delete (yyvsp[(4) - (4)].TypeVal);
6443   ;}
6444     break;
6445
6446   case 322:
6447 #line 3084 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6448     {
6449     if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6450       GEN_ERROR("select condition must be boolean");
6451     if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6452       GEN_ERROR("select value types should match");
6453     (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6454     CHECK_FOR_ERROR
6455   ;}
6456     break;
6457
6458   case 323:
6459 #line 3092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6460     {
6461     if (!UpRefs.empty())
6462       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6463     (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6464     delete (yyvsp[(4) - (4)].TypeVal);
6465     CHECK_FOR_ERROR
6466   ;}
6467     break;
6468
6469   case 324:
6470 #line 3099 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6471     {
6472     if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6473       GEN_ERROR("Invalid extractelement operands");
6474     (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6475     CHECK_FOR_ERROR
6476   ;}
6477     break;
6478
6479   case 325:
6480 #line 3105 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6481     {
6482     if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6483       GEN_ERROR("Invalid insertelement operands");
6484     (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6485     CHECK_FOR_ERROR
6486   ;}
6487     break;
6488
6489   case 326:
6490 #line 3111 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6491     {
6492     if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6493       GEN_ERROR("Invalid shufflevector operands");
6494     (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6495     CHECK_FOR_ERROR
6496   ;}
6497     break;
6498
6499   case 327:
6500 #line 3117 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6501     {
6502     const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6503     if (!Ty->isFirstClassType())
6504       GEN_ERROR("PHI node operands must be of first class type");
6505     (yyval.InstVal) = PHINode::Create(Ty);
6506     ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6507     while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6508       if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty) 
6509         GEN_ERROR("All elements of a PHI node must be of the same type");
6510       cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6511       (yyvsp[(2) - (2)].PHIList)->pop_front();
6512     }
6513     delete (yyvsp[(2) - (2)].PHIList);  // Free the list...
6514     CHECK_FOR_ERROR
6515   ;}
6516     break;
6517
6518   case 328:
6519 #line 3133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6520     {
6521
6522     // Handle the short syntax
6523     const PointerType *PFTy = 0;
6524     const FunctionType *Ty = 0;
6525     if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6526         !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6527       // Pull out the types of all of the arguments...
6528       std::vector<const Type*> ParamTypes;
6529       ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6530       for (; I != E; ++I) {
6531         const Type *Ty = I->Val->getType();
6532         if (Ty == Type::VoidTy)
6533           GEN_ERROR("Short call syntax cannot be used with varargs");
6534         ParamTypes.push_back(Ty);
6535       }
6536
6537       if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
6538         GEN_ERROR("Invalid result type for LLVM function");
6539
6540       Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6541       PFTy = PointerType::getUnqual(Ty);
6542     }
6543
6544     Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal));   // Get the function we're calling...
6545     CHECK_FOR_ERROR
6546
6547     // Check for call to invalid intrinsic to avoid crashing later.
6548     if (Function *theF = dyn_cast<Function>(V)) {
6549       if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6550           (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6551           !theF->getIntrinsicID(true))
6552         GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6553                   theF->getName() + "'");
6554     }
6555
6556     // Set up the ParamAttrs for the function
6557     SmallVector<ParamAttrsWithIndex, 8> Attrs;
6558     if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6559       Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
6560     // Check the arguments 
6561     ValueList Args;
6562     if ((yyvsp[(6) - (8)].ParamList)->empty()) {                                   // Has no arguments?
6563       // Make sure no arguments is a good thing!
6564       if (Ty->getNumParams() != 0)
6565         GEN_ERROR("No arguments passed to a function that "
6566                        "expects arguments");
6567     } else {                                     // Has arguments?
6568       // Loop through FunctionType's arguments and ensure they are specified
6569       // correctly.  Also, gather any parameter attributes.
6570       FunctionType::param_iterator I = Ty->param_begin();
6571       FunctionType::param_iterator E = Ty->param_end();
6572       ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6573       unsigned index = 1;
6574
6575       for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6576         if (ArgI->Val->getType() != *I)
6577           GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6578                          (*I)->getDescription() + "'");
6579         Args.push_back(ArgI->Val);
6580         if (ArgI->Attrs != ParamAttr::None)
6581           Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6582       }
6583       if (Ty->isVarArg()) {
6584         if (I == E)
6585           for (; ArgI != ArgE; ++ArgI, ++index) {
6586             Args.push_back(ArgI->Val); // push the remaining varargs
6587             if (ArgI->Attrs != ParamAttr::None)
6588               Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6589           }
6590       } else if (I != E || ArgI != ArgE)
6591         GEN_ERROR("Invalid number of parameters detected");
6592     }
6593
6594     // Finish off the ParamAttrs and check them
6595     PAListPtr PAL;
6596     if (!Attrs.empty())
6597       PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6598
6599     // Create the call node
6600     CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6601     CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6602     CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6603     CI->setParamAttrs(PAL);
6604     (yyval.InstVal) = CI;
6605     delete (yyvsp[(6) - (8)].ParamList);
6606     delete (yyvsp[(3) - (8)].TypeVal);
6607     CHECK_FOR_ERROR
6608   ;}
6609     break;
6610
6611   case 329:
6612 #line 3222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6613     {
6614     (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6615     CHECK_FOR_ERROR
6616   ;}
6617     break;
6618
6619   case 330:
6620 #line 3227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6621     {
6622     (yyval.BoolVal) = true;
6623     CHECK_FOR_ERROR
6624   ;}
6625     break;
6626
6627   case 331:
6628 #line 3231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6629     {
6630     (yyval.BoolVal) = false;
6631     CHECK_FOR_ERROR
6632   ;}
6633     break;
6634
6635   case 332:
6636 #line 3238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6637     {
6638     if (!UpRefs.empty())
6639       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6640     (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6641     delete (yyvsp[(2) - (3)].TypeVal);
6642     CHECK_FOR_ERROR
6643   ;}
6644     break;
6645
6646   case 333:
6647 #line 3245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6648     {
6649     if (!UpRefs.empty())
6650       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6651     if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6652       GEN_ERROR("Malloc array size is not a 32-bit integer!");
6653     Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6654     CHECK_FOR_ERROR
6655     (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6656     delete (yyvsp[(2) - (6)].TypeVal);
6657   ;}
6658     break;
6659
6660   case 334:
6661 #line 3255 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6662     {
6663     if (!UpRefs.empty())
6664       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6665     (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6666     delete (yyvsp[(2) - (3)].TypeVal);
6667     CHECK_FOR_ERROR
6668   ;}
6669     break;
6670
6671   case 335:
6672 #line 3262 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6673     {
6674     if (!UpRefs.empty())
6675       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6676     if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6677       GEN_ERROR("Alloca array size is not a 32-bit integer!");
6678     Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6679     CHECK_FOR_ERROR
6680     (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6681     delete (yyvsp[(2) - (6)].TypeVal);
6682   ;}
6683     break;
6684
6685   case 336:
6686 #line 3272 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6687     {
6688     if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6689       GEN_ERROR("Trying to free nonpointer type " + 
6690                      (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6691     (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6692     CHECK_FOR_ERROR
6693   ;}
6694     break;
6695
6696   case 337:
6697 #line 3280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6698     {
6699     if (!UpRefs.empty())
6700       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6701     if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6702       GEN_ERROR("Can't load from nonpointer type: " +
6703                      (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6704     if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6705       GEN_ERROR("Can't load from pointer of non-first-class type: " +
6706                      (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6707     Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6708     CHECK_FOR_ERROR
6709     (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6710     delete (yyvsp[(3) - (5)].TypeVal);
6711   ;}
6712     break;
6713
6714   case 338:
6715 #line 3294 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6716     {
6717     if (!UpRefs.empty())
6718       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6719     const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6720     if (!PT)
6721       GEN_ERROR("Can't store to a nonpointer type: " +
6722                      (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6723     const Type *ElTy = PT->getElementType();
6724     if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6725       GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6726                      "' into space of type '" + ElTy->getDescription() + "'");
6727
6728     Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6729     CHECK_FOR_ERROR
6730     (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6731     delete (yyvsp[(5) - (7)].TypeVal);
6732   ;}
6733     break;
6734
6735   case 339:
6736 #line 3311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6737     {
6738   Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
6739   if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
6740       GEN_ERROR("Invalid getresult operands");
6741     (yyval.InstVal) = new GetResultInst(TmpVal, (yyvsp[(5) - (5)].UInt64Val));
6742     delete (yyvsp[(2) - (5)].TypeVal);
6743     CHECK_FOR_ERROR
6744   ;}
6745     break;
6746
6747   case 340:
6748 #line 3319 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6749     {
6750     if (!UpRefs.empty())
6751       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6752     if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6753       GEN_ERROR("getelementptr insn requires pointer operand");
6754
6755     if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6756       GEN_ERROR("Invalid getelementptr indices for type '" +
6757                      (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6758     Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6759     CHECK_FOR_ERROR
6760     (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6761     delete (yyvsp[(2) - (4)].TypeVal); 
6762     delete (yyvsp[(4) - (4)].ValueList);
6763   ;}
6764     break;
6765
6766   case 341:
6767 #line 3334 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6768     {
6769     if (!UpRefs.empty())
6770       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6771     if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
6772       GEN_ERROR("extractvalue insn requires an aggregate operand");
6773
6774     if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
6775       GEN_ERROR("Invalid extractvalue indices for type '" +
6776                      (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6777     Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6778     CHECK_FOR_ERROR
6779     (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
6780     delete (yyvsp[(2) - (4)].TypeVal); 
6781     delete (yyvsp[(4) - (4)].ConstantList);
6782   ;}
6783     break;
6784
6785   case 342:
6786 #line 3349 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6787     {
6788     if (!UpRefs.empty())
6789       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
6790     if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
6791       GEN_ERROR("extractvalue insn requires an aggregate operand");
6792
6793     if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
6794       GEN_ERROR("Invalid insertvalue indices for type '" +
6795                      (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
6796     Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
6797     Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6798     CHECK_FOR_ERROR
6799     (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
6800     delete (yyvsp[(2) - (7)].TypeVal); 
6801     delete (yyvsp[(5) - (7)].TypeVal);
6802     delete (yyvsp[(7) - (7)].ConstantList);
6803   ;}
6804     break;
6805
6806
6807 /* Line 1267 of yacc.c.  */
6808 #line 6809 "llvmAsmParser.tab.c"
6809       default: break;
6810     }
6811   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6812
6813   YYPOPSTACK (yylen);
6814   yylen = 0;
6815   YY_STACK_PRINT (yyss, yyssp);
6816
6817   *++yyvsp = yyval;
6818
6819
6820   /* Now `shift' the result of the reduction.  Determine what state
6821      that goes to, based on the state we popped back to and the rule
6822      number reduced by.  */
6823
6824   yyn = yyr1[yyn];
6825
6826   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6827   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6828     yystate = yytable[yystate];
6829   else
6830     yystate = yydefgoto[yyn - YYNTOKENS];
6831
6832   goto yynewstate;
6833
6834
6835 /*------------------------------------.
6836 | yyerrlab -- here on detecting error |
6837 `------------------------------------*/
6838 yyerrlab:
6839   /* If not already recovering from an error, report this error.  */
6840   if (!yyerrstatus)
6841     {
6842       ++yynerrs;
6843 #if ! YYERROR_VERBOSE
6844       yyerror (YY_("syntax error"));
6845 #else
6846       {
6847         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6848         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6849           {
6850             YYSIZE_T yyalloc = 2 * yysize;
6851             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6852               yyalloc = YYSTACK_ALLOC_MAXIMUM;
6853             if (yymsg != yymsgbuf)
6854               YYSTACK_FREE (yymsg);
6855             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6856             if (yymsg)
6857               yymsg_alloc = yyalloc;
6858             else
6859               {
6860                 yymsg = yymsgbuf;
6861                 yymsg_alloc = sizeof yymsgbuf;
6862               }
6863           }
6864
6865         if (0 < yysize && yysize <= yymsg_alloc)
6866           {
6867             (void) yysyntax_error (yymsg, yystate, yychar);
6868             yyerror (yymsg);
6869           }
6870         else
6871           {
6872             yyerror (YY_("syntax error"));
6873             if (yysize != 0)
6874               goto yyexhaustedlab;
6875           }
6876       }
6877 #endif
6878     }
6879
6880
6881
6882   if (yyerrstatus == 3)
6883     {
6884       /* If just tried and failed to reuse look-ahead token after an
6885          error, discard it.  */
6886
6887       if (yychar <= YYEOF)
6888         {
6889           /* Return failure if at end of input.  */
6890           if (yychar == YYEOF)
6891             YYABORT;
6892         }
6893       else
6894         {
6895           yydestruct ("Error: discarding",
6896                       yytoken, &yylval);
6897           yychar = YYEMPTY;
6898         }
6899     }
6900
6901   /* Else will try to reuse look-ahead token after shifting the error
6902      token.  */
6903   goto yyerrlab1;
6904
6905
6906 /*---------------------------------------------------.
6907 | yyerrorlab -- error raised explicitly by YYERROR.  |
6908 `---------------------------------------------------*/
6909 yyerrorlab:
6910
6911   /* Pacify compilers like GCC when the user code never invokes
6912      YYERROR and the label yyerrorlab therefore never appears in user
6913      code.  */
6914   if (/*CONSTCOND*/ 0)
6915      goto yyerrorlab;
6916
6917   /* Do not reclaim the symbols of the rule which action triggered
6918      this YYERROR.  */
6919   YYPOPSTACK (yylen);
6920   yylen = 0;
6921   YY_STACK_PRINT (yyss, yyssp);
6922   yystate = *yyssp;
6923   goto yyerrlab1;
6924
6925
6926 /*-------------------------------------------------------------.
6927 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
6928 `-------------------------------------------------------------*/
6929 yyerrlab1:
6930   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
6931
6932   for (;;)
6933     {
6934       yyn = yypact[yystate];
6935       if (yyn != YYPACT_NINF)
6936         {
6937           yyn += YYTERROR;
6938           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6939             {
6940               yyn = yytable[yyn];
6941               if (0 < yyn)
6942                 break;
6943             }
6944         }
6945
6946       /* Pop the current state because it cannot handle the error token.  */
6947       if (yyssp == yyss)
6948         YYABORT;
6949
6950
6951       yydestruct ("Error: popping",
6952                   yystos[yystate], yyvsp);
6953       YYPOPSTACK (1);
6954       yystate = *yyssp;
6955       YY_STACK_PRINT (yyss, yyssp);
6956     }
6957
6958   if (yyn == YYFINAL)
6959     YYACCEPT;
6960
6961   *++yyvsp = yylval;
6962
6963
6964   /* Shift the error token.  */
6965   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
6966
6967   yystate = yyn;
6968   goto yynewstate;
6969
6970
6971 /*-------------------------------------.
6972 | yyacceptlab -- YYACCEPT comes here.  |
6973 `-------------------------------------*/
6974 yyacceptlab:
6975   yyresult = 0;
6976   goto yyreturn;
6977
6978 /*-----------------------------------.
6979 | yyabortlab -- YYABORT comes here.  |
6980 `-----------------------------------*/
6981 yyabortlab:
6982   yyresult = 1;
6983   goto yyreturn;
6984
6985 #ifndef yyoverflow
6986 /*-------------------------------------------------.
6987 | yyexhaustedlab -- memory exhaustion comes here.  |
6988 `-------------------------------------------------*/
6989 yyexhaustedlab:
6990   yyerror (YY_("memory exhausted"));
6991   yyresult = 2;
6992   /* Fall through.  */
6993 #endif
6994
6995 yyreturn:
6996   if (yychar != YYEOF && yychar != YYEMPTY)
6997      yydestruct ("Cleanup: discarding lookahead",
6998                  yytoken, &yylval);
6999   /* Do not reclaim the symbols of the rule which action triggered
7000      this YYABORT or YYACCEPT.  */
7001   YYPOPSTACK (yylen);
7002   YY_STACK_PRINT (yyss, yyssp);
7003   while (yyssp != yyss)
7004     {
7005       yydestruct ("Cleanup: popping",
7006                   yystos[*yyssp], yyvsp);
7007       YYPOPSTACK (1);
7008     }
7009 #ifndef yyoverflow
7010   if (yyss != yyssa)
7011     YYSTACK_FREE (yyss);
7012 #endif
7013 #if YYERROR_VERBOSE
7014   if (yymsg != yymsgbuf)
7015     YYSTACK_FREE (yymsg);
7016 #endif
7017   /* Make sure YYID is used.  */
7018   return YYID (yyresult);
7019 }
7020
7021
7022 #line 3368 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
7023
7024
7025 // common code from the two 'RunVMAsmParser' functions
7026 static Module* RunParser(Module * M) {
7027   CurModule.CurrentModule = M;
7028   // Check to make sure the parser succeeded
7029   if (yyparse()) {
7030     if (ParserResult)
7031       delete ParserResult;
7032     return 0;
7033   }
7034
7035   // Emit an error if there are any unresolved types left.
7036   if (!CurModule.LateResolveTypes.empty()) {
7037     const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7038     if (DID.Type == ValID::LocalName) {
7039       GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7040     } else {
7041       GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7042     }
7043     if (ParserResult)
7044       delete ParserResult;
7045     return 0;
7046   }
7047
7048   // Emit an error if there are any unresolved values left.
7049   if (!CurModule.LateResolveValues.empty()) {
7050     Value *V = CurModule.LateResolveValues.back();
7051     std::map<Value*, std::pair<ValID, int> >::iterator I =
7052       CurModule.PlaceHolderInfo.find(V);
7053
7054     if (I != CurModule.PlaceHolderInfo.end()) {
7055       ValID &DID = I->second.first;
7056       if (DID.Type == ValID::LocalName) {
7057         GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7058       } else {
7059         GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7060       }
7061       if (ParserResult)
7062         delete ParserResult;
7063       return 0;
7064     }
7065   }
7066
7067   // Check to make sure that parsing produced a result
7068   if (!ParserResult)
7069     return 0;
7070
7071   // Reset ParserResult variable while saving its value for the result.
7072   Module *Result = ParserResult;
7073   ParserResult = 0;
7074
7075   return Result;
7076 }
7077
7078 void llvm::GenerateError(const std::string &message, int LineNo) {
7079   if (LineNo == -1) LineNo = LLLgetLineNo();
7080   // TODO: column number in exception
7081   if (TheParseError)
7082     TheParseError->setError(LLLgetFilename(), message, LineNo);
7083   TriggerError = 1;
7084 }
7085
7086 int yyerror(const char *ErrorMsg) {
7087   std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7088   std::string errMsg = where + "error: " + std::string(ErrorMsg);
7089   if (yychar != YYEMPTY && yychar != 0) {
7090     errMsg += " while reading token: '";
7091     errMsg += std::string(LLLgetTokenStart(), 
7092                           LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7093   }
7094   GenerateError(errMsg);
7095   return 0;
7096 }
7097