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