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