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