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