aboutsummaryrefslogtreecommitdiff
path: root/lib/AsmParser/llvmAsmParser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-22 18:36:00 +0000
committerChris Lattner <sabre@nondot.org>2001-07-22 18:36:00 +0000
commita28504313d4c3fe87173a71b511dd4c8e25c3312 (patch)
treed4badd0bbe33e6e77c51cb5a569e1a4314e69674 /lib/AsmParser/llvmAsmParser.cpp
parent86b5f3c52417c2d85595844a73fd2134d8975038 (diff)
Remove dependence on command line library. Silly anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/llvmAsmParser.cpp')
-rw-r--r--lib/AsmParser/llvmAsmParser.cpp2420
1 files changed, 0 insertions, 2420 deletions
diff --git a/lib/AsmParser/llvmAsmParser.cpp b/lib/AsmParser/llvmAsmParser.cpp
deleted file mode 100644
index 649759b768..0000000000
--- a/lib/AsmParser/llvmAsmParser.cpp
+++ /dev/null
@@ -1,2420 +0,0 @@
-
-/* A Bison parser, made from llvmAsmParser.y
- by GNU Bison version 1.28 */
-
-#define YYBISON 1 /* Identify Bison output. */
-
-#define yyparse llvmAsmparse
-#define yylex llvmAsmlex
-#define yyerror llvmAsmerror
-#define yylval llvmAsmlval
-#define yychar llvmAsmchar
-#define yydebug llvmAsmdebug
-#define yynerrs llvmAsmnerrs
-#define ESINT64VAL 257
-#define EUINT64VAL 258
-#define SINTVAL 259
-#define UINTVAL 260
-#define FPVAL 261
-#define VOID 262
-#define BOOL 263
-#define SBYTE 264
-#define UBYTE 265
-#define SHORT 266
-#define USHORT 267
-#define INT 268
-#define UINT 269
-#define LONG 270
-#define ULONG 271
-#define FLOAT 272
-#define DOUBLE 273
-#define STRING 274
-#define TYPE 275
-#define LABEL 276
-#define VAR_ID 277
-#define LABELSTR 278
-#define STRINGCONSTANT 279
-#define IMPLEMENTATION 280
-#define TRUE 281
-#define FALSE 282
-#define BEGINTOK 283
-#define END 284
-#define DECLARE 285
-#define TO 286
-#define RET 287
-#define BR 288
-#define SWITCH 289
-#define NOT 290
-#define ADD 291
-#define SUB 292
-#define MUL 293
-#define DIV 294
-#define REM 295
-#define SETLE 296
-#define SETGE 297
-#define SETLT 298
-#define SETGT 299
-#define SETEQ 300
-#define SETNE 301
-#define MALLOC 302
-#define ALLOCA 303
-#define FREE 304
-#define LOAD 305
-#define STORE 306
-#define GETELEMENTPTR 307
-#define PHI 308
-#define CALL 309
-#define CAST 310
-#define SHL 311
-#define SHR 312
-
-#line 13 "llvmAsmParser.y"
-
-#include "ParserInternals.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Method.h"
-#include "llvm/SymbolTable.h"
-#include "llvm/Module.h"
-#include "llvm/Type.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Assembly/Parser.h"
-#include "llvm/ConstantPool.h"
-#include "llvm/iTerminators.h"
-#include "llvm/iMemory.h"
-#include <list>
-#include <utility> // Get definition of pair class
-#include <algorithm> // Get definition of find_if
-#include <stdio.h> // This embarasment is due to our flex lexer...
-
-int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
-int yylex(); // declaration" of xxx warnings.
-int yyparse();
-
-static Module *ParserResult;
-const ToolCommandLine *CurOptions = 0;
-
-// This contains info used when building the body of a method. It is destroyed
-// when the method is completed.
-//
-typedef vector<Value *> ValueList; // Numbered defs
-static void ResolveDefinitions(vector<ValueList> &LateResolvers);
-
-static struct PerModuleInfo {
- Module *CurrentModule;
- vector<ValueList> Values; // Module level numbered definitions
- vector<ValueList> LateResolveValues;
-
- void ModuleDone() {
- // If we could not resolve some blocks at parsing time (forward branches)
- // resolve the branches now...
- ResolveDefinitions(LateResolveValues);
-
- Values.clear(); // Clear out method local definitions
- CurrentModule = 0;
- }
-} CurModule;
-
-static struct PerMethodInfo {
- Method *CurrentMethod; // Pointer to current method being created
-
- vector<ValueList> Values; // Keep track of numbered definitions
- vector<ValueList> LateResolveValues;
- bool isDeclare; // Is this method a forward declararation?
-
- inline PerMethodInfo() {
- CurrentMethod = 0;
- isDeclare = false;
- }
-
- inline ~PerMethodInfo() {}
-
- inline void MethodStart(Method *M) {
- CurrentMethod = M;
- }
-
- void MethodDone() {
- // If we could not resolve some blocks at parsing time (forward branches)
- // resolve the branches now...
- ResolveDefinitions(LateResolveValues);
-
- Values.clear(); // Clear out method local definitions
- CurrentMethod = 0;
- isDeclare = false;
- }
-} CurMeth; // Info for the current method...
-
-
-//===----------------------------------------------------------------------===//
-// Code to handle definitions of all the types
-//===----------------------------------------------------------------------===//
-
-static void InsertValue(Value *D, vector<ValueList> &ValueTab = CurMeth.Values) {
- if (!D->hasName()) { // Is this a numbered definition?
- unsigned type = D->getType()->getUniqueID();
- if (ValueTab.size() <= type)
- ValueTab.resize(type+1, ValueList());
- //printf("Values[%d][%d] = %d\n", type, ValueTab[type].size(), D);
- ValueTab[type].push_back(D);
- }
-}
-
-static Value *getVal(const Type *Type, ValID &D,
- bool DoNotImprovise = false) {
- switch (D.Type) {
- case 0: { // Is it a numbered definition?
- unsigned type = Type->getUniqueID();
- unsigned Num = (unsigned)D.Num;
-
- // Module constants occupy the lowest numbered slots...
- if (type < CurModule.Values.size()) {
- if (Num < CurModule.Values[type].size())
- return CurModule.Values[type][Num];
-
- Num -= CurModule.Values[type].size();
- }
-
- // Make sure that our type is within bounds
- if (CurMeth.Values.size() <= type)
- break;
-
- // Check that the number is within bounds...
- if (CurMeth.Values[type].size() <= Num)
- break;
-
- return CurMeth.Values[type][Num];
- }
- case 1: { // Is it a named definition?
- string Name(D.Name);
- SymbolTable *SymTab = 0;
- if (CurMeth.CurrentMethod)
- SymTab = CurMeth.CurrentMethod->getSymbolTable();
- Value *N = SymTab ? SymTab->lookup(Type, Name) : 0;
-
- if (N == 0) {
- SymTab = CurModule.CurrentModule->getSymbolTable();
- if (SymTab)
- N = SymTab->lookup(Type, Name);
- if (N == 0) break;
- }
-
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
-
- case 2: // Is it a constant pool reference??
- case 3: // Is it an unsigned const pool reference?
- case 4: // Is it a string const pool reference?
- case 5:{ // Is it a floating point const pool reference?
- ConstPoolVal *CPV = 0;
-
- // Check to make sure that "Type" is an integral type, and that our
- // value will fit into the specified type...
- switch (D.Type) {
- case 2:
- if (Type == Type::BoolTy) { // Special handling for boolean data
- CPV = new ConstPoolBool(D.ConstPool64 != 0);
- } else {
- if (!ConstPoolSInt::isValueValidForType(Type, D.ConstPool64))
- ThrowException("Symbolic constant pool value '" +
- itostr(D.ConstPool64) + "' is invalid for type '" +
- Type->getName() + "'!");
- CPV = new ConstPoolSInt(Type, D.ConstPool64);
- }
- break;
- case 3:
- if (!ConstPoolUInt::isValueValidForType(Type, D.UConstPool64)) {
- if (!ConstPoolSInt::isValueValidForType(Type, D.ConstPool64)) {
- ThrowException("Integral constant pool reference is invalid!");
- } else { // This is really a signed reference. Transmogrify.
- CPV = new ConstPoolSInt(Type, D.ConstPool64);
- }
- } else {
- CPV = new ConstPoolUInt(Type, D.UConstPool64);
- }
- break;
- case 4:
- cerr << "FIXME: TODO: String constants [sbyte] not implemented yet!\n";
- abort();
- //CPV = new ConstPoolString(D.Name);
- D.destroy(); // Free the string memory
- break;
- case 5:
- if (!ConstPoolFP::isValueValidForType(Type, D.ConstPoolFP))
- ThrowException("FP constant invalid for type!!");
- else
- CPV = new ConstPoolFP(Type, D.ConstPoolFP);
- break;
- }
- assert(CPV && "How did we escape creating a constant??");
-
- // Scan through the constant table and see if we already have loaded this
- // constant.
- //
- ConstantPool &CP = CurMeth.CurrentMethod ?
- CurMeth.CurrentMethod->getConstantPool() :
- CurModule.CurrentModule->getConstantPool();
- ConstPoolVal *C = CP.find(CPV); // Already have this constant?
- if (C) {
- delete CPV; // Didn't need this after all, oh well.
- return C; // Yup, we already have one, recycle it!
- }
- CP.insert(CPV);
-
- // Success, everything is kosher. Lets go!
- return CPV;
- } // End of case 2,3,4
- } // End of switch
-
-
- // If we reached here, we referenced either a symbol that we don't know about
- // or an id number that hasn't been read yet. We may be referencing something
- // forward, so just create an entry to be resolved later and get to it...
- //
- if (DoNotImprovise) return 0; // Do we just want a null to be returned?
-
- // TODO: Attempt to coallecse nodes that are the same with previous ones.
- Value *d = 0;
- switch (Type->getPrimitiveID()) {
- case Type::LabelTyID: d = new BBPlaceHolder(Type, D); break;
- case Type::MethodTyID:
- d = new MethPlaceHolder(Type, D);
- InsertValue(d, CurModule.LateResolveValues);
- return d;
-//case Type::ClassTyID: d = new ClassPlaceHolder(Type, D); break;
- default: d = new DefPlaceHolder(Type, D); break;
- }
-
- assert(d != 0 && "How did we not make something?");
- InsertValue(d, CurMeth.LateResolveValues);
- return d;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Code to handle forward references in instructions
-//===----------------------------------------------------------------------===//
-//
-// This code handles the late binding needed with statements that reference
-// values not defined yet... for example, a forward branch, or the PHI node for
-// a loop body.
-//
-// This keeps a table (CurMeth.LateResolveValues) of all such forward references
-// and back patchs after we are done.
-//
-
-// ResolveDefinitions - If we could not resolve some defs at parsing
-// time (forward branches, phi functions for loops, etc...) resolve the
-// defs now...
-//
-static void ResolveDefinitions(vector<ValueList> &LateResolvers) {
- // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
- for (unsigned ty = 0; ty < LateResolvers.size(); ty++) {
- while (!LateResolvers[ty].empty()) {
- Value *V = LateResolvers[ty].back();
- LateResolvers[ty].pop_back();
- ValID &DID = getValIDFromPlaceHolder(V);
-
- Value *TheRealValue = getVal(Type::getUniqueIDType(ty), DID, true);
-
- if (TheRealValue == 0 && DID.Type == 1)
- ThrowException("Reference to an invalid definition: '" +DID.getName() +
- "' of type '" + V->getType()->getName() + "'");
- else if (TheRealValue == 0)
- ThrowException("Reference to an invalid definition: #" +itostr(DID.Num)+
- " of type '" + V->getType()->getName() + "'");
-
- V->replaceAllUsesWith(TheRealValue);
- assert(V->use_empty());
- delete V;
- }
- }
-
- LateResolvers.clear();
-}
-
-// addConstValToConstantPool - This code is used to insert a constant into the
-// current constant pool. This is designed to make maximal (but not more than
-// possible) reuse (merging) of constants in the constant pool. This means that
-// multiple references to %4, for example will all get merged.
-//
-static ConstPoolVal *addConstValToConstantPool(ConstPoolVal *C) {
- vector<ValueList> &ValTab = CurMeth.CurrentMethod ?
- CurMeth.Values : CurModule.Values;
- ConstantPool &CP = CurMeth.CurrentMethod ?
- CurMeth.CurrentMethod->getConstantPool() :
- CurModule.CurrentModule->getConstantPool();
-
- if (ConstPoolVal *CPV = CP.find(C)) {
- // Constant already in constant pool. Try to merge the two constants
- if (CPV->hasName() && !C->hasName()) {
- // Merge the two values, we inherit the existing CPV's name.
- // InsertValue requires that the value have no name to insert correctly
- // (because we want to fill the slot this constant would have filled)
- //
- string Name = CPV->getName();
- CPV->setName("");
- InsertValue(CPV, ValTab);
- CPV->setName(Name);
- delete C;
- return CPV;
- } else if (!CPV->hasName() && C->hasName()) {
- // If we have a name on this value and there isn't one in the const
- // pool val already, propogate it.
- //
- CPV->setName(C->getName());
- delete C; // Sorry, you're toast
- return CPV;
- } else if (CPV->hasName() && C->hasName()) {
- // Both values have distinct names. We cannot merge them.
- CP.insert(C);
- InsertValue(C, ValTab);
- return C;
- } else if (!CPV->hasName() && !C->hasName()) {
- // Neither value has a name, trivially merge them.
- InsertValue(CPV, ValTab);
- delete C;
- return CPV;
- }
-
- assert(0 && "Not reached!");
- return 0;
- } else { // No duplication of value.
- CP.insert(C);
- InsertValue(C, ValTab);
- return C;
- }
-}
-
-
-struct EqualsType {
- const Type *T;
- inline EqualsType(const Type *t) { T = t; }
- inline bool operator()(const ConstPoolVal *CPV) const {
- return static_cast<const ConstPoolType*>(CPV)->getValue() == T;
- }
-};
-
-
-// checkNewType - We have to be careful to add all types referenced by the
-// program to the constant pool of the method or module. Because of this, we
-// often want to check to make sure that types used are in the constant pool,
-// and add them if they aren't. That's what this function does.
-//
-static const Type *checkNewType(const Type *Ty) {
- ConstantPool &CP = CurMeth.CurrentMethod ?
- CurMeth.CurrentMethod->getConstantPool() :
- CurModule.CurrentModule->getConstantPool();
-
- // TODO: This should use ConstantPool::ensureTypeAvailable
-
- // Get the type type plane...
- ConstantPool::PlaneType &P = CP.getPlane(Type::TypeTy);
- ConstantPool::PlaneType::const_iterator PI = find_if(P.begin(), P.end(),
- EqualsType(Ty));
- if (PI == P.end()) {
- vector<ValueList> &ValTab = CurMeth.CurrentMethod ?
- CurMeth.Values : CurModule.Values;
- ConstPoolVal *CPT = new ConstPoolType(Ty);
- CP.insert(CPT);
- InsertValue(CPT, ValTab);
- }
- return Ty;
-}
-
-
-//===----------------------------------------------------------------------===//
-// RunVMAsmParser - Define an interface to this parser
-//===----------------------------------------------------------------------===//
-//
-Module *RunVMAsmParser(const ToolCommandLine &Opts, FILE *F) {
- llvmAsmin = F;
- CurOptions = &Opts;
- llvmAsmlineno = 1; // Reset the current line number...
-
- CurModule.CurrentModule = new Module(); // Allocate a new module to read
- yyparse(); // Parse the file.
- Module *Result = ParserResult;
- CurOptions = 0;
- llvmAsmin = stdin; // F is about to go away, don't use it anymore...
- ParserResult = 0;
-
- return Result;
-}
-
-
-#line 387 "llvmAsmParser.y"
-typedef union {
- Module *ModuleVal;
- Method *MethodVal;
- MethodArgument *MethArgVal;
- BasicBlock *BasicBlockVal;
- TerminatorInst *TermInstVal;
- Instruction *InstVal;
- ConstPoolVal *ConstVal;
- const Type *TypeVal;
-
- list<MethodArgument*> *MethodArgList;
- list<Value*> *ValueList;
- list<const Type*> *TypeList;
- list<pair<Value*, BasicBlock*> > *PHIList; // Represent the RHS of PHI node
- list<pair<ConstPoolVal*, BasicBlock*> > *JumpTable;
- vector<ConstPoolVal*> *ConstVector;
-
- int64_t SInt64Val;
- uint64_t UInt64Val;
- int SIntVal;
- unsigned UIntVal;
- double FPVal;
-
- char *StrVal; // This memory is allocated by strdup!
- ValID ValIDVal; // May contain memory allocated by strdup
-
- Instruction::UnaryOps UnaryOpVal;
- Instruction::BinaryOps BinaryOpVal;
- Instruction::TermOps TermOpVal;
- Instruction::MemoryOps MemOpVal;
- Instruction::OtherOps OtherOpVal;
-} YYSTYPE;
-#include <stdio.h>
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define YYFINAL 269
-#define YYFLAG -32768
-#define YYNTBASE 69
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 312 ? yytranslate[x] : 110)
-
-static const char yytranslate[] = { 0,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 66,
- 67, 68, 2, 65, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 59, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 60, 2, 61, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 62,
- 2, 2, 63, 2, 64, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = { 0,
- 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
- 20, 22, 24, 26, 28, 30, 32, 34, 36, 38,
- 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
- 60, 62, 64, 66, 68, 70, 72, 74, 76, 78,
- 80, 82, 84, 86, 88, 90, 92, 95, 96, 99,
- 102, 105, 108, 111, 114, 117, 124, 130, 139, 147,
- 154, 159, 163, 165, 169, 170, 172, 175, 178, 181,
- 183, 184, 187, 191, 193, 195, 196, 202, 206, 209,
- 210, 214, 216, 218, 220, 222, 224, 226, 228, 230,
- 232, 234, 239, 243, 247, 253, 257, 260, 263, 265,
- 269, 272, 275, 278, 282, 285, 286, 290, 293, 297,
- 307, 317, 324, 330, 333, 340, 348, 351, 356, 358,
- 359, 365, 369, 376, 382, 385, 392, 394, 397, 398,
- 401, 407, 410, 416, 420, 425, 433
-};
-
-static const short yyrhs[] = { 5,
- 0, 6, 0, 3, 0, 4, 0, 9, 0, 10,
- 0, 11, 0, 12, 0, 13, 0, 14, 0, 15,
- 0, 16, 0, 17, 0, 18, 0, 19, 0, 20,
- 0, 21, 0, 22, 0, 71, 0, 8, 0, 36,
- 0, 37, 0, 38, 0, 39, 0, 40, 0, 41,
- 0, 42, 0, 43, 0, 44, 0, 45, 0, 46,
- 0, 47, 0, 57, 0, 58, 0, 16, 0, 14,
- 0, 12, 0, 10, 0, 17, 0, 15, 0, 13,
- 0, 11, 0, 76, 0, 77, 0, 18, 0, 19,
- 0, 23, 59, 0, 0, 76, 70, 0, 77, 4,
- 0, 9, 27, 0, 9, 28, 0, 79, 7, 0,
- 20, 25, 0, 21, 71, 0, 60, 71, 61, 60,
- 82, 61, 0, 60, 71, 61, 60, 61, 0, 60,
- 4, 62, 71, 61, 60, 82, 61, 0, 60, 4,
- 62, 71, 61, 60, 61, 0, 63, 97, 64, 63,
- 82, 64, 0, 63, 64, 63, 64, 0, 82, 65,
- 81, 0, 81, 0, 83, 80, 81, 0, 0, 85,
- 0, 85, 92, 0, 85, 93, 0, 83, 26, 0,
- 23, 0, 0, 71, 86, 0, 87, 65, 88, 0,
- 87, 0, 88, 0, 0, 72, 25, 66, 89, 67,
- 0, 90, 83, 29, 0, 98, 30, 0, 0, 31,
- 94, 90, 0, 3, 0, 4, 0, 7, 0, 27,
- 0, 28, 0, 25, 0, 69, 0, 23, 0, 95,
- 0, 96, 0, 72, 66, 97, 67, 0, 72, 66,
- 67, 0, 60, 71, 61, 0, 60, 4, 62, 71,
- 61, 0, 63, 97, 64, 0, 63, 64, 0, 71,
- 68, 0, 71, 0, 97, 65, 71, 0, 98, 99,
- 0, 91, 99, 0, 100, 101, 0, 24, 100, 101,
- 0, 100, 103, 0, 0, 33, 71, 96, 0, 33,
- 8, 0, 34, 22, 96, 0, 34, 9, 96, 65,
- 22, 96, 65, 22, 96, 0, 35, 78, 96, 65,
- 22, 96, 60, 102, 61, 0, 102, 78, 95, 65,
- 22, 96, 0, 78, 95, 65, 22, 96, 0, 80,
- 107, 0, 71, 60, 96, 65, 96, 61, 0, 104,
- 65, 60, 96, 65, 96, 61, 0, 71, 96, 0,
- 105, 65, 71, 96, 0, 105, 0, 0, 74, 71,
- 96, 65, 96, 0, 73, 71, 96, 0, 75, 71,
- 96, 65, 71, 96, 0, 56, 71, 96, 32, 71,
- 0, 54, 104, 0, 55, 71, 96, 66, 106, 67,
- 0, 109, 0, 65, 82, 0, 0, 48, 71, 0,
- 48, 71, 65, 15, 96, 0, 49, 71, 0, 49,
- 71, 65, 15, 96, 0, 50, 71, 96, 0, 51,
- 71, 96, 108, 0, 52, 71, 96, 65, 71, 96,
- 108, 0, 53, 71, 96, 108, 0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
- 486, 487, 494, 495, 506, 506, 506, 506, 506, 506,
- 506, 507, 507, 507, 507, 507, 507, 507, 510, 510,
- 515, 516, 516, 516, 516, 516, 517, 517, 517, 517,
- 517, 517, 518, 518, 522, 522, 522, 522, 523, 523,
- 523, 523, 524, 524, 525, 525, 528, 531, 538, 543,
- 548, 551, 554, 557, 563, 566, 579, 583, 601, 608,
- 616, 630, 633, 643, 660, 671, 678, 684, 690, 699,
- 699, 701, 709, 713, 718, 721, 725, 766, 770, 774,
- 774, 782, 785, 788, 791, 794, 797, 802, 805, 808,
- 815, 823, 828, 832, 835, 838, 843, 846, 851, 855,
- 860, 864, 873, 878, 887, 891, 895, 898, 901, 904,
- 909, 920, 928, 938, 946, 951, 958, 962, 968, 968,
- 970, 975, 980, 984, 987, 998, 1035, 1040, 1042, 1046,
- 1049, 1056, 1059, 1067, 1073, 1082, 1094
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL",
-"EUINT64VAL","SINTVAL","UINTVAL","FPVAL","VOID","BOOL","SBYTE","UBYTE","SHORT",
-"USHORT","INT","UINT","LONG","ULONG","FLOAT","DOUBLE","STRING","TYPE","LABEL",
-"VAR_ID","LABELSTR","STRINGCONSTANT","IMPLEMENTATION","TRUE","FALSE","BEGINTOK",
-"END","DECLARE","TO","RET","BR","SWITCH","NOT","ADD","SUB","MUL","DIV","REM",
-"SETLE","SETGE","SETLT","SETGT","SETEQ","SETNE","MALLOC","ALLOCA","FREE","LOAD",
-"STORE","GETELEMENTPTR","PHI","CALL","CAST","SHL","SHR","'='","'['","']'","'x'",
-"'{'","'}'","','","'('","')'","'*'","INTVAL","EINT64VAL","Types","TypesV","UnaryOps",
-"BinaryOps","ShiftOps","SIntType","UIntType","IntType","FPType","OptAssign",
-"ConstVal","ConstVector","ConstPool","Module","MethodList","OptVAR_ID","ArgVal",
-"ArgListH","ArgList","MethodHeaderH","MethodHeader","Method","MethodProto","@1",
-"ConstValueRef","ValueRef","TypeList","BasicBlockList","BasicBlock","InstructionList",
-"BBTerminatorInst","JumpTable","Inst","PHIList","ValueRefList","ValueRefListE",
-"InstVal","UByteList","MemoryInst", NULL
-};
-#endif
-
-static const short yyr1[] = { 0,
- 69, 69, 70, 70, 71, 71, 71, 71, 71, 71,
- 71, 71, 71, 71, 71, 71, 71, 71, 72, 72,
- 73, 74, 74, 74, 74, 74, 74, 74, 74, 74,
- 74, 74, 75, 75, 76, 76, 76, 76, 77, 77,
- 77, 77, 78, 78, 79, 79, 80, 80, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 82, 82, 83, 83, 84, 85, 85, 85, 86,
- 86, 87, 88, 88, 89, 89, 90, 91, 92, 94,
- 93, 95, 95, 95, 95, 95, 95, 96, 96, 96,
- 71, 71, 71, 71, 71, 71, 71, 71, 97, 97,
- 98, 98, 99, 99, 100, 100, 101, 101, 101, 101,
- 101, 102, 102, 103, 104, 104, 105, 105, 106, 106,
- 107, 107, 107, 107, 107, 107, 107, 108, 108, 109,
- 109, 109, 109, 109, 109, 109, 109
-};
-
-static const short yyr2[] = { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 2, 0, 2, 2,
- 2, 2, 2, 2, 2, 6, 5, 8, 7, 6,
- 4, 3, 1, 3, 0, 1, 2, 2, 2, 1,
- 0, 2, 3, 1, 1, 0, 5, 3, 2, 0,
- 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 4, 3, 3, 5, 3, 2, 2, 1, 3,
- 2, 2, 2, 3, 2, 0, 3, 2, 3, 9,
- 9, 6, 5, 2, 6, 7, 2, 4, 1, 0,
- 5, 3, 6, 5, 2, 6, 1, 2, 0, 2,
- 5, 2, 5, 3, 4, 7, 4
-};
-
-static const short yydefact[] = { 65,
- 48, 66, 0, 69, 0, 82, 83, 1, 2, 84,
- 20, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 89, 87, 85, 86, 80,
- 0, 0, 88, 19, 0, 65, 106, 67, 68, 90,
- 91, 106, 47, 0, 38, 42, 37, 41, 36, 40,
- 35, 39, 45, 46, 0, 0, 0, 0, 0, 0,
- 0, 64, 0, 83, 19, 0, 97, 99, 0, 98,
- 0, 0, 48, 106, 102, 48, 79, 101, 51, 52,
- 54, 55, 83, 19, 0, 0, 3, 4, 49, 50,
- 53, 81, 0, 94, 96, 0, 76, 93, 0, 78,
- 48, 0, 0, 0, 0, 103, 105, 0, 0, 0,
- 0, 19, 100, 71, 74, 75, 0, 92, 104, 108,
- 19, 0, 0, 43, 44, 0, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 33, 34, 0,
- 0, 0, 114, 127, 19, 0, 61, 0, 95, 70,
- 72, 0, 77, 107, 0, 109, 0, 130, 132, 19,
- 19, 19, 19, 19, 125, 19, 19, 19, 19, 19,
- 0, 57, 63, 0, 0, 73, 0, 0, 0, 0,
- 134, 129, 0, 129, 0, 0, 0, 0, 122, 0,
- 0, 0, 56, 0, 60, 0, 0, 0, 0, 0,
- 135, 0, 137, 0, 0, 120, 0, 0, 0, 59,
- 0, 62, 0, 0, 131, 133, 128, 19, 0, 0,
- 19, 119, 0, 124, 121, 19, 58, 0, 0, 129,
- 0, 0, 117, 0, 126, 123, 0, 0, 0, 136,
- 115, 0, 19, 110, 0, 111, 0, 116, 118, 0,
- 0, 0, 0, 113, 0, 112, 0, 0, 0
-};
-
-static const short yydefgoto[] = { 33,
- 89, 68, 66, 150, 151, 152, 59, 60, 126, 61,
- 5, 183, 184, 1, 267, 2, 161, 115, 116, 117,
- 36, 37, 38, 39, 63, 40, 41, 69, 42, 75,
- 76, 106, 249, 107, 175, 232, 233, 153, 211, 154
-};
-
-static const short yypact[] = {-32768,
- 2, 354, -36,-32768, 557,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- 415, 266,-32768, -9, -16,-32768, 66,-32768,-32768,-32768,
--32768, 46,-32768, 145,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768, 68, 441, 502, 328, 191, 119,
- 124,-32768, 441, 92, -3, 117,-32768, 37, 132,-32768,
- 133, 240, 101,-32768,-32768, 64,-32768,-32768,-32768,-32768,
--32768, 37, 144, 13, 148, 137,-32768,-32768,-32768,-32768,
--32768,-32768, 441,-32768,-32768, 441, 441,-32768, 55,-32768,
- 64, 528, 40, 165, 556,-32768,-32768, 441, 147, 149,
- 153, 24, 37, 7, 143,-32768, 152,-32768,-32768, 146,
- -1, 163, 163,-32768,-32768, 163,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 441, 441,
- 441, 441, 441, 441, 441, 441, 441,-32768,-32768, 441,
- 441, 441,-32768,-32768, 28, 23,-32768, 557,-32768,-32768,
--32768, 441,-32768,-32768, 155,-32768, 157, 36, 87, -1,
- -1, -1, -1, 20, 158, -1, -1, -1, -1, -1,
- 164,-32768,-32768, 60, 140,-32768, 203, 204, 212, 213,
--32768, 166, 167, 166, 163, 169, 168, 198,-32768, 170,
- 171, 98,-32768, 557,-32768, 163, 163, 163, 163, 557,
--32768, 441,-32768, 172, 163, 441, 441, 163, 441,-32768,
- 128,-32768, 173, 179,-32768,-32768, 175, -1, 163, 176,
- -1, 199, 223, 37,-32768, -1,-32768, 211, 165, 166,
- 205, 163,-32768, 441,-32768,-32768, 163, 44, 3,-32768,
--32768, 231, -1,-32768, 230,-32768, 44,-32768,-32768, 274,
- 232, 163, 276,-32768, 163,-32768, 299, 301,-32768
-};
-
-static const short yypgoto[] = {-32768,
--32768, -2, 5,-32768,-32768,-32768, -93, -92, -186,-32768,
- -55, -4, -150, 268,-32768,-32768,-32768,-32768, 150,-32768,
- 239,-32768,-32768,-32768,-32768, -191, -44, -27,-32768, 263,
- 234, 208,-32768,-32768,-32768,-32768,-32768,-32768, -184,-32768
-};
-
-
-#define YYLAST 620
-
-
-static const short yytable[] = { 34,
- 62, 6, 7, 8, 9, 10, 35, 185, 71, 213,
- 124, 125, 45, 46, 47, 48, 49, 50, 51, 52,
- 105, 26, 43, 27, 3, 28, 29, 4, 65, 160,
- 86, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 99, 105, 6, 7, 122, 72,
- 10, 221, 248, 82, 84, 250, 255, 94, 70, 227,
- 34, 123, 257, 256, 70, 261, 70, 35, 27, 74,
- 28, 29, -19, 109, 70, 77, 164, 165, 166, 195,
- 70, 167, 57, 182, 159, 58, 3, 70, 181, 74,
- 112, 70, 81, 113, 114, 70, 102, 103, 104, 121,
- 189, -19, -19, 70, 70, 155, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 96,
- 203, 118, 90, 3, 204, 191, 192, 193, 194, 100,
- 91, 197, 198, 199, 200, 201, 168, 169, 170, 171,
- 172, 173, 174, 176, 177, 124, 125, 178, 179, 180,
- 214, 190, -19, 93, 70, 124, 125, 57, 220, 114,
- 58, 223, 224, 225, 226, 6, 7, 8, 9, 10,
- 230, 79, 80, 235, 45, 46, 47, 48, 49, 50,
- 51, 52, 72, 240, 241, 26, 243, 27, 237, 28,
- 29, 246, 204, 87, 88, 95, 96, 252, 97, 222,
- 111, 96, 254, 205, 204, 108, 156, 162, 259, 228,
- 110, -20, 157, 231, 234, 158, 236, 264, 163, 187,
- 266, 188, 196, 202, 206, 207, 208, 209, 215, 217,
- 210, 212, 247, 216, 218, 219, 229, 238, 239, 204,
- 242, 253, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 244, 27, 251, 28, 29, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 24, 25, 26, 245,
- 27, 258, 28, 29, 260, 262, 263, 265, 268, 31,
- 269, 92, 32, 73, 78, 0, 98, 101, 119, 0,
- 0, 186, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 31, 0, 0, 32, 67,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 0, 27, 0, 28, 29, 6, 7, 8, 9,
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 0, 27, 0,
- 28, 29, 0, 0, 30, 0, 0, 31, 0, 0,
- 32, 85, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 31, 0, 0, 32, 6, 64, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 0, 27,
- 0, 28, 29, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 0, 27, 0, 28, 29, 0,
- 0, 0, 0, 0, 31, 0, 0, 32, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 31, 0, 0, 32, 6, 83, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 0, 27, 0, 28, 29,
- 6, 7, 8, 9, 10, 120, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 0, 27, 0, 28, 29, 0, 0, 0, 0,
- 0, 31, 0, 0, 32, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 31, 0, 0,
- 32, 127, 128, 129, 130, 131, 132, 133, 134, 135,
- 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
- 146, 147, 148, 149, 0, 0, 57, 0, 0, 58
-};
-
-static const short yycheck[] = { 2,
- 5, 3, 4, 5, 6, 7, 2, 158, 25, 194,
- 104, 104, 10, 11, 12, 13, 14, 15, 16, 17,
- 76, 23, 59, 25, 23, 27, 28, 26, 31, 23,
- 58, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 72, 101, 3, 4, 9, 66,
- 7, 202, 239, 56, 57, 240, 248, 61, 68, 210,
- 63, 22, 249, 61, 68, 257, 68, 63, 25, 24,
- 27, 28, 66, 61, 68, 30, 121, 122, 123, 60,
- 68, 126, 60, 61, 61, 63, 23, 68, 61, 24,
- 93, 68, 25, 96, 97, 68, 33, 34, 35, 102,
- 65, 66, 66, 68, 68, 108, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 65,
- 61, 67, 4, 23, 65, 170, 171, 172, 173, 29,
- 7, 176, 177, 178, 179, 180, 139, 140, 141, 142,
- 143, 144, 145, 146, 147, 239, 239, 150, 151, 152,
- 195, 65, 66, 62, 68, 249, 249, 60, 61, 162,
- 63, 206, 207, 208, 209, 3, 4, 5, 6, 7,
- 215, 27, 28, 218, 10, 11, 12, 13, 14, 15,
- 16, 17, 66, 228, 229, 23, 231, 25, 61, 27,
- 28, 236, 65, 3, 4, 64, 65, 242, 66, 204,
- 64, 65, 247, 64, 65, 62, 60, 65, 253, 212,
- 63, 66, 64, 216, 217, 63, 219, 262, 67, 65,
- 265, 65, 65, 60, 22, 22, 15, 15, 60, 32,
- 65, 65, 22, 66, 65, 65, 65, 65, 60, 65,
- 65, 244, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12