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