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