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