aboutsummaryrefslogtreecommitdiff
path: root/lib/AsmParser/llvmAsmParser.cpp.cvs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AsmParser/llvmAsmParser.cpp.cvs')
-rw-r--r--lib/AsmParser/llvmAsmParser.cpp.cvs5134
1 files changed, 2688 insertions, 2446 deletions
diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs
index 7af40bb6f4..01888429ac 100644
--- a/lib/AsmParser/llvmAsmParser.cpp.cvs
+++ b/lib/AsmParser/llvmAsmParser.cpp.cvs
@@ -1,7 +1,7 @@
-/* A Bison parser, made from /usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y, by GNU bison 1.75. */
+/* A Bison parser, made by GNU Bison 2.1. */
/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,8 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
@@ -34,16 +34,21 @@
USER NAME SPACE" below. */
/* Identify Bison output. */
-#define YYBISON 1
+#define YYBISON 1
+
+/* Bison version. */
+#define YYBISON_VERSION "2.1"
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
-#define YYPURE 0
+#define YYPURE 0
/* Using locations. */
#define YYLSP_NEEDED 0
-/* If NAME_PREFIX is specified substitute the variables and functions
- names. */
+/* Substitute the variable and function names. */
#define yyparse llvmAsmparse
#define yylex llvmAsmlex
#define yyerror llvmAsmerror
@@ -61,8 +66,8 @@
enum yytokentype {
ESINT64VAL = 258,
EUINT64VAL = 259,
- SINTVAL = 260,
- UINTVAL = 261,
+ LOCALVAL_ID = 260,
+ GLOBALVAL_ID = 261,
FPVAL = 262,
VOID = 263,
INTTYPE = 264,
@@ -70,131 +75,130 @@
DOUBLE = 266,
LABEL = 267,
TYPE = 268,
- VAR_ID = 269,
- LABELSTR = 270,
- STRINGCONSTANT = 271,
- IMPLEMENTATION = 272,
- ZEROINITIALIZER = 273,
- TRUETOK = 274,
- FALSETOK = 275,
- BEGINTOK = 276,
- ENDTOK = 277,
- DECLARE = 278,
- DEFINE = 279,
- GLOBAL = 280,
- CONSTANT = 281,
- SECTION = 282,
- VOLATILE = 283,
- TO = 284,
- DOTDOTDOT = 285,
- NULL_TOK = 286,
- UNDEF = 287,
- INTERNAL = 288,
- LINKONCE = 289,
- WEAK = 290,
- APPENDING = 291,
- DLLIMPORT = 292,
- DLLEXPORT = 293,
- EXTERN_WEAK = 294,
- OPAQUE = 295,
- EXTERNAL = 296,
- TARGET = 297,
- TRIPLE = 298,
- ENDIAN = 299,
- POINTERSIZE = 300,
- LITTLE = 301,
- BIG = 302,
- ALIGN = 303,
- DEPLIBS = 304,
- CALL = 305,
- TAIL = 306,
- ASM_TOK = 307,
- MODULE = 308,
- SIDEEFFECT = 309,
- CC_TOK = 310,
- CCC_TOK = 311,
- CSRETCC_TOK = 312,
- FASTCC_TOK = 313,
- COLDCC_TOK = 314,
- X86_STDCALLCC_TOK = 315,
- X86_FASTCALLCC_TOK = 316,
- DATALAYOUT = 317,
- RET = 318,
- BR = 319,
- SWITCH = 320,
- INVOKE = 321,
- UNWIND = 322,
- UNREACHABLE = 323,
- ADD = 324,
- SUB = 325,
- MUL = 326,
- UDIV = 327,
- SDIV = 328,
- FDIV = 329,
- UREM = 330,
- SREM = 331,
- FREM = 332,
- AND = 333,
- OR = 334,
- XOR = 335,
- ICMP = 336,
- FCMP = 337,
- EQ = 338,
- NE = 339,
- SLT = 340,
- SGT = 341,
- SLE = 342,
- SGE = 343,
- ULT = 344,
- UGT = 345,
- ULE = 346,
- UGE = 347,
- OEQ = 348,
- ONE = 349,
- OLT = 350,
- OGT = 351,
- OLE = 352,
- OGE = 353,
- ORD = 354,
- UNO = 355,
- UEQ = 356,
- UNE = 357,
- MALLOC = 358,
- ALLOCA = 359,
- FREE = 360,
- LOAD = 361,
- STORE = 362,
- GETELEMENTPTR = 363,
- TRUNC = 364,
- ZEXT = 365,
- SEXT = 366,
- FPTRUNC = 367,
- FPEXT = 368,
- BITCAST = 369,
- UITOFP = 370,
- SITOFP = 371,
- FPTOUI = 372,
- FPTOSI = 373,
- INTTOPTR = 374,
- PTRTOINT = 375,
- PHI_TOK = 376,
- SELECT = 377,
- SHL = 378,
- LSHR = 379,
- ASHR = 380,
- VAARG = 381,
- EXTRACTELEMENT = 382,
- INSERTELEMENT = 383,
- SHUFFLEVECTOR = 384,
- NORETURN = 385,
- DEFAULT = 386,
- HIDDEN = 387
+ LOCALVAR = 269,
+ GLOBALVAR = 270,
+ LABELSTR = 271,
+ STRINGCONSTANT = 272,
+ ATSTRINGCONSTANT = 273,
+ IMPLEMENTATION = 274,
+ ZEROINITIALIZER = 275,
+ TRUETOK = 276,
+ FALSETOK = 277,
+ BEGINTOK = 278,
+ ENDTOK = 279,
+ DECLARE = 280,
+ DEFINE = 281,
+ GLOBAL = 282,
+ CONSTANT = 283,
+ SECTION = 284,
+ VOLATILE = 285,
+ TO = 286,
+ DOTDOTDOT = 287,
+ NULL_TOK = 288,
+ UNDEF = 289,
+ INTERNAL = 290,
+ LINKONCE = 291,
+ WEAK = 292,
+ APPENDING = 293,
+ DLLIMPORT = 294,
+ DLLEXPORT = 295,
+ EXTERN_WEAK = 296,
+ OPAQUE = 297,
+ EXTERNAL = 298,
+ TARGET = 299,
+ TRIPLE = 300,
+ ALIGN = 301,
+ DEPLIBS = 302,
+ CALL = 303,
+ TAIL = 304,
+ ASM_TOK = 305,
+ MODULE = 306,
+ SIDEEFFECT = 307,
+ CC_TOK = 308,
+ CCC_TOK = 309,
+ CSRETCC_TOK = 310,
+ FASTCC_TOK = 311,
+ COLDCC_TOK = 312,
+ X86_STDCALLCC_TOK = 313,
+ X86_FASTCALLCC_TOK = 314,
+ DATALAYOUT = 315,
+ RET = 316,
+ BR = 317,
+ SWITCH = 318,
+ INVOKE = 319,
+ UNWIND = 320,
+ UNREACHABLE = 321,
+ ADD = 322,
+ SUB = 323,
+ MUL = 324,
+ UDIV = 325,
+ SDIV = 326,
+ FDIV = 327,
+ UREM = 328,
+ SREM = 329,
+ FREM = 330,
+ AND = 331,
+ OR = 332,
+ XOR = 333,
+ ICMP = 334,
+ FCMP = 335,
+ EQ = 336,
+ NE = 337,
+ SLT = 338,
+ SGT = 339,
+ SLE = 340,
+ SGE = 341,
+ ULT = 342,
+ UGT = 343,
+ ULE = 344,
+ UGE = 345,
+ OEQ = 346,
+ ONE = 347,
+ OLT = 348,
+ OGT = 349,
+ OLE = 350,
+ OGE = 351,
+ ORD = 352,
+ UNO = 353,
+ UEQ = 354,
+ UNE = 355,
+ MALLOC = 356,
+ ALLOCA = 357,
+ FREE = 358,
+ LOAD = 359,
+ STORE = 360,
+ GETELEMENTPTR = 361,
+ TRUNC = 362,
+ ZEXT = 363,
+ SEXT = 364,
+ FPTRUNC = 365,
+ FPEXT = 366,
+ BITCAST = 367,
+ UITOFP = 368,
+ SITOFP = 369,
+ FPTOUI = 370,
+ FPTOSI = 371,
+ INTTOPTR = 372,
+ PTRTOINT = 373,
+ PHI_TOK = 374,
+ SELECT = 375,
+ SHL = 376,
+ LSHR = 377,
+ ASHR = 378,
+ VAARG = 379,
+ EXTRACTELEMENT = 380,
+ INSERTELEMENT = 381,
+ SHUFFLEVECTOR = 382,
+ NORETURN = 383,
+ DEFAULT = 384,
+ HIDDEN = 385
};
#endif
+/* Tokens. */
#define ESINT64VAL 258
#define EUINT64VAL 259
-#define SINTVAL 260
-#define UINTVAL 261
+#define LOCALVAL_ID 260
+#define GLOBALVAL_ID 261
#define FPVAL 262
#define VOID 263
#define INTTYPE 264
@@ -202,131 +206,129 @@
#define DOUBLE 266
#define LABEL 267
#define TYPE 268
-#define VAR_ID 269
-#define LABELSTR 270
-#define STRINGCONSTANT 271
-#define IMPLEMENTATION 272
-#define ZEROINITIALIZER 273
-#define TRUETOK 274
-#define FALSETOK 275
-#define BEGINTOK 276
-#define ENDTOK 277
-#define DECLARE 278
-#define DEFINE 279
-#define GLOBAL 280
-#define CONSTANT 281
-#define SECTION 282
-#define VOLATILE 283
-#define TO 284
-#define DOTDOTDOT 285
-#define NULL_TOK 286
-#define UNDEF 287
-#define INTERNAL 288
-#define LINKONCE 289
-#define WEAK 290
-#define APPENDING 291
-#define DLLIMPORT 292
-#define DLLEXPORT 293
-#define EXTERN_WEAK 294
-#define OPAQUE 295
-#define EXTERNAL 296
-#define TARGET 297
-#define TRIPLE 298
-#define ENDIAN 299
-#define POINTERSIZE 300
-#define LITTLE 301
-#define BIG 302
-#define ALIGN 303
-#define DEPLIBS 304
-#define CALL 305
-#define TAIL 306
-#define ASM_TOK 307
-#define MODULE 308
-#define SIDEEFFECT 309
-#define CC_TOK 310
-#define CCC_TOK 311
-#define CSRETCC_TOK 312
-#define FASTCC_TOK 313
-#define COLDCC_TOK 314
-#define X86_STDCALLCC_TOK 315
-#define X86_FASTCALLCC_TOK 316
-#define DATALAYOUT 317
-#define RET 318
-#define BR 319
-#define SWITCH 320
-#define INVOKE 321
-#define UNWIND 322
-#define UNREACHABLE 323
-#define ADD 324
-#define SUB 325
-#define MUL 326
-#define UDIV 327
-#define SDIV 328
-#define FDIV 329
-#define UREM 330
-#define SREM 331
-#define FREM 332
-#define AND 333
-#define OR 334
-#define XOR 335
-#define ICMP 336
-#define FCMP 337
-#define EQ 338
-#define NE 339
-#define SLT 340
-#define SGT 341
-#define SLE 342
-#define SGE 343
-#define ULT 344
-#define UGT 345
-#define ULE 346
-#define UGE 347
-#define OEQ 348
-#define ONE 349
-#define OLT 350
-#define OGT 351
-#define OLE 352
-#define OGE 353
-#define ORD 354
-#define UNO 355
-#define UEQ 356
-#define UNE 357
-#define MALLOC 358
-#define ALLOCA 359
-#define FREE 360
-#define LOAD 361
-#define STORE 362
-#define GETELEMENTPTR 363
-#define TRUNC 364
-#define ZEXT 365
-#define SEXT 366
-#define FPTRUNC 367
-#define FPEXT 368
-#define BITCAST 369
-#define UITOFP 370
-#define SITOFP 371
-#define FPTOUI 372
-#define FPTOSI 373
-#define INTTOPTR 374
-#define PTRTOINT 375
-#define PHI_TOK 376
-#define SELECT 377
-#define SHL 378
-#define LSHR 379
-#define ASHR 380
-#define VAARG 381
-#define EXTRACTELEMENT 382
-#define INSERTELEMENT 383
-#define SHUFFLEVECTOR 384
-#define NORETURN 385
-#define DEFAULT 386
-#define HIDDEN 387
+#define LOCALVAR 269
+#define GLOBALVAR 270
+#define LABELSTR 271
+#define STRINGCONSTANT 272
+#define ATSTRINGCONSTANT 273
+#define IMPLEMENTATION 274
+#define ZEROINITIALIZER 275
+#define TRUETOK 276
+#define FALSETOK 277
+#define BEGINTOK 278
+#define ENDTOK 279
+#define DECLARE 280
+#define DEFINE 281
+#define GLOBAL 282
+#define CONSTANT 283
+#define SECTION 284
+#define VOLATILE 285
+#define TO 286
+#define DOTDOTDOT 287
+#define NULL_TOK 288
+#define UNDEF 289
+#define INTERNAL 290
+#define LINKONCE 291
+#define WEAK 292
+#define APPENDING 293
+#define DLLIMPORT 294
+#define DLLEXPORT 295
+#define EXTERN_WEAK 296
+#define OPAQUE 297
+#define EXTERNAL 298
+#define TARGET 299
+#define TRIPLE 300
+#define ALIGN 301
+#define DEPLIBS 302
+#define CALL 303
+#define TAIL 304
+#define ASM_TOK 305
+#define MODULE 306
+#define SIDEEFFECT 307
+#define CC_TOK 308
+#define CCC_TOK 309
+#define CSRETCC_TOK 310
+#define FASTCC_TOK 311
+#define COLDCC_TOK 312
+#define X86_STDCALLCC_TOK 313
+#define X86_FASTCALLCC_TOK 314
+#define DATALAYOUT 315
+#define RET 316
+#define BR 317
+#define SWITCH 318
+#define INVOKE 319
+#define UNWIND 320
+#define UNREACHABLE 321
+#define ADD 322
+#define SUB 323
+#define MUL 324
+#define UDIV 325
+#define SDIV 326
+#define FDIV 327
+#define UREM 328
+#define SREM 329
+#define FREM 330
+#define AND 331
+#define OR 332
+#define XOR 333
+#define ICMP 334
+#define FCMP 335
+#define EQ 336
+#define NE 337
+#define SLT 338
+#define SGT 339
+#define SLE 340
+#define SGE 341
+#define ULT 342
+#define UGT 343
+#define ULE 344
+#define UGE 345
+#define OEQ 346
+#define ONE 347
+#define OLT 348
+#define OGT 349
+#define OLE 350
+#define OGE 351
+#define ORD 352
+#define UNO 353
+#define UEQ 354
+#define UNE 355
+#define MALLOC 356
+#define ALLOCA 357
+#define FREE 358
+#define LOAD 359
+#define STORE 360
+#define GETELEMENTPTR 361
+#define TRUNC 362
+#define ZEXT 363
+#define SEXT 364
+#define FPTRUNC 365
+#define FPEXT 366
+#define BITCAST 367
+#define UITOFP 368
+#define SITOFP 369
+#define FPTOUI 370
+#define FPTOSI 371
+#define INTTOPTR 372
+#define PTRTOINT 373
+#define PHI_TOK 374
+#define SELECT 375
+#define SHL 376
+#define LSHR 377
+#define ASHR 378
+#define VAARG 379
+#define EXTRACTELEMENT 380
+#define INSERTELEMENT 381
+#define SHUFFLEVECTOR 382
+#define NORETURN 383
+#define DEFAULT 384
+#define HIDDEN 385
/* Copy the first part of user declarations. */
-#line 14 "/usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
#include "ParserInternals.h"
#include "llvm/CallingConv.h"
@@ -586,12 +588,12 @@ static int InsertValue(Value *V,
static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
switch (D.Type) {
- case ValID::NumberVal: // Is it a numbered definition?
+ case ValID::LocalID: // Is it a numbered definition?
// Module constants occupy the lowest numbered slots...
- if ((unsigned)D.Num < CurModule.Types.size())
- return CurModule.Types[(unsigned)D.Num];
+ if (D.Num < CurModule.Types.size())
+ return CurModule.Types[D.Num];
break;
- case ValID::NameVal: // Is it a named definition?
+ case ValID::LocalName: // Is it a named definition?
if (const Type *N = CurModule.CurrentModule->getTypeByName(D.Name)) {
D.destroy(); // Free old strdup'd memory...
return N;
@@ -610,11 +612,11 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
if (inFunctionScope()) {
- if (D.Type == ValID::NameVal) {
+ if (D.Type == ValID::LocalName) {
GenerateError("Reference to an undefined type: '" + D.getName() + "'");
return 0;
} else {
- GenerateError("Reference to an undefined type: #" + itostr(D.Num));
+ GenerateError("Reference to an undefined type: #" + utostr(D.Num));
return 0;
}
}
@@ -628,13 +630,6 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
return Typ;
}
-static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) {
- SymbolTable &SymTab =
- inFunctionScope() ? CurFun.CurrentFunction->getValueSymbolTable() :
- CurModule.CurrentModule->getValueSymbolTable();
- return SymTab.lookup(Ty, Name);
-}
-
// getValNonImprovising - Look up the value specified by the provided type and
// the provided ValID. If the value exists and has already been defined, return
// it. Otherwise return null.
@@ -647,29 +642,39 @@ static Value *getValNonImprovising(const Type *Ty, const ValID &D) {
}
switch (D.Type) {
- case ValID::NumberVal: { // Is it a numbered definition?
- unsigned Num = (unsigned)D.Num;
-
- // Module constants occupy the lowest numbered slots...
- std::map<const Type*,ValueList>::iterator VI = CurModule.Values.find(Ty);
- if (VI != CurModule.Values.end()) {
- if (Num < VI->second.size())
- return VI->second[Num];
- Num -= VI->second.size();
- }
-
- // Make sure that our type is within bounds
- VI = CurFun.Values.find(Ty);
+ case ValID::LocalID: { // Is it a numbered definition?
+ // Module constants occupy the lowest numbered slots.
+ std::map<const Type*,ValueList>::iterator VI = CurFun.Values.find(Ty);
+ // Make sure that our type is within bounds.
if (VI == CurFun.Values.end()) return 0;
- // Check that the number is within bounds...
- if (VI->second.size() <= Num) return 0;
+ // Check that the number is within bounds.
+ if (D.Num >= VI->second.size()) return 0;
+ return VI->second[D.Num];
+ }
+ case ValID::GlobalID: { // Is it a numbered definition?
+ unsigned Num = D.Num;
+
+ // Module constants occupy the lowest numbered slots...
+ std::map<const Type*,ValueList>::iterator VI = CurModule.Values.find(Ty);
+ if (VI == CurModule.Values.end()) return 0;
+ if (D.Num >= VI->second.size()) return 0;
return VI->second[Num];
}
-
- case ValID::NameVal: { // Is it a named definition?
- Value *N = lookupInSymbolTable(Ty, std::string(D.Name));
+
+ case ValID::LocalName: { // Is it a named definition?
+ if (!inFunctionScope()) return 0;
+ SymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
+ Value *N = SymTab.lookup(Ty, D.Name);
+ if (N == 0) return 0;
+
+ D.destroy(); // Free old strdup'd memory...
+ return N;
+ }
+ case ValID::GlobalName: { // Is it a named definition?
+ SymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
+ Value *N = SymTab.lookup(Ty, D.Name);
if (N == 0) return 0;
D.destroy(); // Free old strdup'd memory...
@@ -804,12 +809,12 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
default:
GenerateError("Illegal label reference " + ID.getName());
return 0;
- case ValID::NumberVal: // Is it a numbered definition?
- if (unsigned(ID.Num) >= CurFun.NumberedBlocks.size())
+ case ValID::LocalID: // Is it a numbered definition?
+ if (ID.Num >= CurFun.NumberedBlocks.size())
CurFun.NumberedBlocks.resize(ID.Num+1);
BB = CurFun.NumberedBlocks[ID.Num];
break;
- case ValID::NameVal: // Is it a named definition?
+ case ValID::LocalName: // Is it a named definition?
Name = ID.Name;
if (Value *N = CurFun.CurrentFunction->
getValueSymbolTable().lookup(Type::LabelTy, Name))
@@ -834,7 +839,7 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
// Otherwise this block has not been seen before.
BB = new BasicBlock("", CurFun.CurrentFunction);
- if (ID.Type == ValID::NameVal) {
+ if (ID.Type == ValID::LocalName) {
BB->setName(ID.Name);
} else {
CurFun.NumberedBlocks[ID.Num] = BB;
@@ -901,7 +906,7 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers,
// resolver table
InsertValue(V, *FutureLateResolvers);
} else {
- if (DID.Type == ValID::NameVal) {
+ if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
GenerateError("Reference to an invalid definition: '" +DID.getName()+
"' of type '" + V->getType()->getDescription() + "'",
PHI->second.second);
@@ -926,8 +931,8 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers,
//
static void ResolveTypeTo(char *Name, const Type *ToTy) {
ValID D;
- if (Name) D = ValID::create(Name);
- else D = ValID::create((int)CurModule.Types.size());
+ if (Name) D = ValID::createLocalName(Name);
+ else D = ValID::createLocalID(CurModule.Types.size());
std::map<ValID, PATypeHolder>::iterator I =
CurModule.LateResolveTypes.find(D);
@@ -942,26 +947,25 @@ static void ResolveTypeTo(char *Name, const Type *ToTy) {
// assumed to be a malloc'd string buffer, and is free'd by this function.
//
static void setValueName(Value *V, char *NameStr) {
- if (NameStr) {
- std::string Name(NameStr); // Copy string
- free(NameStr); // Free old string
-
- if (V->getType() == Type::VoidTy) {
- GenerateError("Can't assign name '" + Name+"' to value with void type!");
- return;
- }
+ if (!NameStr) return;
+ std::string Name(NameStr); // Copy string
+ free(NameStr); // Free old string
- assert(inFunctionScope() && "Must be in function scope!");
- SymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
- if (ST.lookup(V->getType(), Name)) {
- GenerateError("Redefinition of value '" + Name + "' of type '" +
- V->getType()->getDescription() + "'!");
- return;
- }
+ if (V->getType() == Type::VoidTy) {
+ GenerateError("Can't assign name '" + Name+"' to value with void type!");
+ return;
+ }
- // Set the name.
- V->setName(Name);
+ assert(inFunctionScope() && "Must be in function scope!");
+ SymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
+ if (ST.lookup(V->getType(), Name)) {
+ GenerateError("Redefinition of value '" + Name + "' of type '" +
+ V->getType()->getDescription() + "'!");
+ return;
}
+
+ // Set the name.
+ V->setName(Name);
}
/// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
@@ -989,9 +993,9 @@ ParseGlobalVariable(char *NameStr,
// object.
ValID ID;
if (!Name.empty()) {
- ID = ValID::create((char*)Name.c_str());
+ ID = ValID::createGlobalName((char*)Name.c_str());
} else {
- ID = ValID::create((int)CurModule.Values[PTy].size());
+ ID = ValID::createGlobalID(CurModule.Values[PTy].size());
}
if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
@@ -1209,9 +1213,14 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
# define YYERROR_VERBOSE 0
#endif
-#ifndef YYSTYPE
-#line 883 "/usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y"
-typedef union {
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 885 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
+typedef union YYSTYPE {
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
llvm::BasicBlock *BasicBlockVal;
@@ -1253,47 +1262,63 @@ typedef union {
llvm::Instruction::MemoryOps MemOpVal;
llvm::Instruction::CastOps CastOpVal;
llvm::Instruction::OtherOps OtherOpVal;
- llvm::Module::Endianness Endianness;
llvm::ICmpInst::Predicate IPredicate;
llvm::FCmpInst::Predicate FPredicate;
-} yystype;
-/* Line 188 of /usr/local/share/bison/yacc.c. */
-#line 1262 "llvmAsmParser.tab.c"
-# define YYSTYPE yystype
+} YYSTYPE;
+/* Line 196 of yacc.c. */
+#line 1270 "llvmAsmParser.tab.c"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
-#ifndef YYLTYPE
-typedef struct yyltype
-{
- int first_line;
- int first_column;
- int last_line;
- int last_column;
-} yyltype;
-# define YYLTYPE yyltype
-# define YYLTYPE_IS_TRIVIAL 1
-#endif
+
/* Copy the second part of user declarations. */
-/* Line 213 of /usr/local/share/bison/yacc.c. */
-#line 1283 "llvmAsmParser.tab.c"
+/* Line 219 of yacc.c. */
+#line 1282 "llvmAsmParser.tab.c"
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(msgid) msgid
+# endif
+#endif
#if ! defined (yyoverflow) || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
-# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# else
-# ifndef YYSTACK_USE_ALLOCA
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
# else
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
+# define YYSTACK_ALLOC alloca
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYINCLUDED_STDLIB_H
# endif
# endif
# endif
@@ -1302,50 +1327,76 @@ typedef struct yyltype
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# ifndef YYSTACK_ALLOC_MAXIMUM
+ /* The OS might guarantee only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
+# endif
# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
+# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
+ && (defined (__STDC__) || defined (__cplusplus)))
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifndef YYFREE
+# define YYFREE free
+# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
+ && (defined (__STDC__) || defined (__cplusplus)))
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifdef __cplusplus
+}
# endif
-# define YYSTACK_ALLOC malloc
-# define YYSTACK_FREE free
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
- || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- short yyss;
+ short int yyss;
YYSTYPE yyvs;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAX)
+ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
-# if 1 < __GNUC__
+# if defined (__GNUC__) && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
- register YYSIZE_T yyi; \
+ YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
+ (To)[yyi] = (From)[yyi]; \
} \
while (0)
# endif
@@ -1362,7 +1413,7 @@ union yyalloc
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
@@ -1372,28 +1423,29 @@ union yyalloc
#if defined (__STDC__) || defined (__cplusplus)
typedef signed char yysigned_char;
#else
- typedef short yysigned_char;
+ typedef short int yysigned_char;
#endif
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 36
-#define YYLAST 1357
+#define YYFINAL 40
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 1476
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 147
+#define YYNTOKENS 145
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 79
/* YYNRULES -- Number of rules. */
#define YYNRULES 285
/* YYNRULES -- Number of states. */
-#define YYNSTATES 569
+#define YYNSTATES 566
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 387
+#define YYMAXUTOK 385
-#define YYTRANSLATE(X) \
- ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const unsigned char yytranslate[] =
@@ -1402,15 +1454,15 @@ static const unsigned char yytranslate[] =
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,
- 137, 138, 135, 2, 134, 2, 2, 2, 2, 2,
+ 135, 136, 133, 2, 132, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 142, 133, 143, 2, 2, 2, 2, 2, 2, 2,
+ 140, 131, 141, 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, 139, 136, 141, 2, 2, 2, 2, 2, 146,
+ 2, 137, 134, 139, 2, 2, 2, 2, 2, 144,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 140, 2, 2, 144, 2, 145, 2, 2, 2, 2,
+ 138, 2, 2, 142, 2, 143, 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,
@@ -1436,13 +1488,13 @@ static const unsigned char yytranslate[] =
95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 127, 128, 129, 130, 131, 132
+ 125, 126, 127, 128, 129, 130
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
-static const unsigned short yyprhs[] =
+static const unsigned short int yyprhs[] =
{
0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
@@ -1450,213 +1502,214 @@ static const unsigned short yyprhs[] =
59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
- 119, 122, 123, 125, 127, 129, 131, 133, 135, 137,
- 139, 140, 142, 143, 145, 147, 148, 150, 152, 154,
- 156, 157, 159, 161, 163, 165, 167, 169, 172, 174,
- 176, 177, 180, 182, 184, 185, 188, 189, 192, 193,
- 197, 200, 201, 203, 204, 208, 210, 213, 215, 217,
- 219, 221, 223, 225, 228, 230, 233, 239, 245, 251,
- 257, 261, 264, 270, 275, 278, 280, 282, 284, 288,
- 290, 294, 296, 297, 299, 303, 308, 312, 316, 321,
- 326, 330, 337, 343, 346, 349, 352, 355, 358, 361,
- 364, 367, 370, 373, 380, 386, 395, 402, 409, 417,
- 425, 432, 439, 448, 457, 461, 463, 465, 467, 469,
- 470, 472, 475, 476, 480, 481, 485, 489, 491, 495,
- 499, 500, 507, 508, 516, 517, 525, 528, 532, 534,
- 536, 538, 542, 546, 550, 554, 558, 562, 564, 565,
- 567, 569, 571, 572, 578, 582, 584, 588, 590, 591,
- 601, 603, 605, 610, 612, 614, 617, 621, 622, 624,
- 626, 628, 630, 632, 634, 636, 638, 640, 644, 646,
- 652, 654, 656, 658, 660, 663, 666, 669, 673, 676,
- 677, 679, 682, 685, 689, 699, 709, 718, 733, 735,
- 737, 744, 750, 753, 760, 768, 772, 778, 779, 780,
- 784, 787, 789, 795, 801, 808, 815, 820, 825, 832,
- 837, 842, 849, 856, 859, 868, 870, 872, 873, 877,
- 884, 888, 895, 898, 903, 910
+ 119, 121, 122, 125, 126, 128, 130, 133, 134, 136,
+ 138, 140, 142, 144, 146, 148, 150, 151, 153, 154,
+ 156, 158, 159, 161, 163, 165, 167, 168, 170, 172,
+ 174, 176, 178, 180, 183, 185, 187, 188, 191, 193,
+ 195, 196, 199, 200, 203, 204, 208, 211, 212, 214,
+ 215, 219, 221, 224, 226, 228, 230, 232, 234, 236,
+ 239, 241, 244, 250, 256, 262, 268, 272, 275, 281,
+ 286, 289, 291, 293, 295, 299, 301, 305, 307, 308,
+ 310, 314, 319, 323, 327, 332, 337, 341, 348, 354,
+ 357, 360, 363, 366, 369, 372, 375, 378, 381, 384,
+ 391, 397, 406, 413, 420, 428, 436, 443, 450, 459,
+ 468, 472, 474, 476, 478, 480, 481, 483, 486, 487,
+ 491, 492, 496, 500, 502, 506, 510, 511, 518, 519,
+ 527, 528, 536, 539, 543, 545, 549, 553, 557, 561,
+ 563, 564, 570, 574, 576, 580, 582, 583, 593, 595,
+ 597, 602, 604, 606, 609, 613, 614, 616, 618, 620,
+ 622, 624, 626, 628, 630, 632, 636, 638, 644, 646,
+ 648, 650, 652, 654, 656, 659, 662, 665, 669, 672,
+ 673, 675, 678, 681, 685, 695, 705, 714, 729, 731,
+ 733, 740, 746, 749, 756, 764, 768, 774, 775, 776,
+ 780, 783, 785, 791, 797, 804, 811, 816, 821, 828,
+ 833, 838, 845, 852, 855, 864, 866, 868, 869, 873,
+ 880, 884, 891, 894, 899, 906
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const short yyrhs[] =
+static const short int yyrhs[] =
{
- 185, 0, -1, 5, -1, 6, -1, 69, -1, 70,
+ 186, 0, -1, 67, -1, 68, -1, 69, -1, 70,
-1, 71, -1, 72, -1, 73, -1, 74, -1, 75,
- -1, 76, -1, 77, -1, 78, -1, 79, -1, 80,
+ -1, 76, -1, 77, -1, 78, -1, 107, -1, 108,
-1, 109, -1, 110, -1, 111, -1, 112, -1, 113,
-1, 114, -1, 115, -1, 116, -1, 117, -1, 118,
- -1, 119, -1, 120, -1, 123, -1, 124, -1, 125,
+ -1, 121, -1, 122, -1, 123, -1, 81, -1, 82,
-1, 83, -1, 84, -1, 85, -1, 86, -1, 87,
-1, 88, -1, 89, -1, 90, -1, 91, -1, 92,
-1, 93, -1, 94, -1, 95, -1, 96, -1, 97,
- -1, 98, -1, 99, -1, 100, -1, 101, -1, 102,
- -1, 89, -1, 90, -1, 91, -1, 92,