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