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