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