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