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