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