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