Regenerate

llvm-svn: 36437
This commit is contained in:
Anton Korobeynikov 2007-04-25 14:29:12 +00:00
parent a97b694c82
commit e9fcbefa9a
5 changed files with 5262 additions and 3884 deletions

File diff suppressed because it is too large Load Diff

View File

@ -222,6 +222,7 @@ datalayout { return DATALAYOUT; }
volatile { return VOLATILE; }
align { return ALIGN; }
section { return SECTION; }
alias { return ALIAS; }
module { return MODULE; }
asm { return ASM_TOK; }
sideeffect { return SIDEEFFECT; }

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,321 @@
typedef union {
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
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
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
ESINT64VAL = 258,
EUINT64VAL = 259,
ESAPINTVAL = 260,
EUAPINTVAL = 261,
LOCALVAL_ID = 262,
GLOBALVAL_ID = 263,
FPVAL = 264,
VOID = 265,
INTTYPE = 266,
FLOAT = 267,
DOUBLE = 268,
LABEL = 269,
TYPE = 270,
LOCALVAR = 271,
GLOBALVAR = 272,
LABELSTR = 273,
STRINGCONSTANT = 274,
ATSTRINGCONSTANT = 275,
ZEROINITIALIZER = 276,
TRUETOK = 277,
FALSETOK = 278,
BEGINTOK = 279,
ENDTOK = 280,
DECLARE = 281,
DEFINE = 282,
GLOBAL = 283,
CONSTANT = 284,
SECTION = 285,
ALIAS = 286,
VOLATILE = 287,
THREAD_LOCAL = 288,
TO = 289,
DOTDOTDOT = 290,
NULL_TOK = 291,
UNDEF = 292,
INTERNAL = 293,
LINKONCE = 294,
WEAK = 295,
APPENDING = 296,
DLLIMPORT = 297,
DLLEXPORT = 298,
EXTERN_WEAK = 299,
OPAQUE = 300,
EXTERNAL = 301,
TARGET = 302,
TRIPLE = 303,
ALIGN = 304,
DEPLIBS = 305,
CALL = 306,
TAIL = 307,
ASM_TOK = 308,
MODULE = 309,
SIDEEFFECT = 310,
CC_TOK = 311,
CCC_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,
SHL = 336,
LSHR = 337,
ASHR = 338,
ICMP = 339,
FCMP = 340,
EQ = 341,
NE = 342,
SLT = 343,
SGT = 344,
SLE = 345,
SGE = 346,
ULT = 347,
UGT = 348,
ULE = 349,
UGE = 350,
OEQ = 351,
ONE = 352,
OLT = 353,
OGT = 354,
OLE = 355,
OGE = 356,
ORD = 357,
UNO = 358,
UEQ = 359,
UNE = 360,
MALLOC = 361,
ALLOCA = 362,
FREE = 363,
LOAD = 364,
STORE = 365,
GETELEMENTPTR = 366,
TRUNC = 367,
ZEXT = 368,
SEXT = 369,
FPTRUNC = 370,
FPEXT = 371,
BITCAST = 372,
UITOFP = 373,
SITOFP = 374,
FPTOUI = 375,
FPTOSI = 376,
INTTOPTR = 377,
PTRTOINT = 378,
PHI_TOK = 379,
SELECT = 380,
VAARG = 381,
EXTRACTELEMENT = 382,
INSERTELEMENT = 383,
SHUFFLEVECTOR = 384,
NORETURN = 385,
INREG = 386,
SRET = 387,
NOUNWIND = 388,
DEFAULT = 389,
HIDDEN = 390
};
#endif
/* Tokens. */
#define ESINT64VAL 258
#define EUINT64VAL 259
#define ESAPINTVAL 260
#define EUAPINTVAL 261
#define LOCALVAL_ID 262
#define GLOBALVAL_ID 263
#define FPVAL 264
#define VOID 265
#define INTTYPE 266
#define FLOAT 267
#define DOUBLE 268
#define LABEL 269
#define TYPE 270
#define LOCALVAR 271
#define GLOBALVAR 272
#define LABELSTR 273
#define STRINGCONSTANT 274
#define ATSTRINGCONSTANT 275
#define ZEROINITIALIZER 276
#define TRUETOK 277
#define FALSETOK 278
#define BEGINTOK 279
#define ENDTOK 280
#define DECLARE 281
#define DEFINE 282
#define GLOBAL 283
#define CONSTANT 284
#define SECTION 285
#define ALIAS 286
#define VOLATILE 287
#define THREAD_LOCAL 288
#define TO 289
#define DOTDOTDOT 290
#define NULL_TOK 291
#define UNDEF 292
#define INTERNAL 293
#define LINKONCE 294
#define WEAK 295
#define APPENDING 296
#define DLLIMPORT 297
#define DLLEXPORT 298
#define EXTERN_WEAK 299
#define OPAQUE 300
#define EXTERNAL 301
#define TARGET 302
#define TRIPLE 303
#define ALIGN 304
#define DEPLIBS 305
#define CALL 306
#define TAIL 307
#define ASM_TOK 308
#define MODULE 309
#define SIDEEFFECT 310
#define CC_TOK 311
#define CCC_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 SHL 336
#define LSHR 337
#define ASHR 338
#define ICMP 339
#define FCMP 340
#define EQ 341
#define NE 342
#define SLT 343
#define SGT 344
#define SLE 345
#define SGE 346
#define ULT 347
#define UGT 348
#define ULE 349
#define UGE 350
#define OEQ 351
#define ONE 352
#define OLT 353
#define OGT 354
#define OLE 355
#define OGE 356
#define ORD 357
#define UNO 358
#define UEQ 359
#define UNE 360
#define MALLOC 361
#define ALLOCA 362
#define FREE 363
#define LOAD 364
#define STORE 365
#define GETELEMENTPTR 366
#define TRUNC 367
#define ZEXT 368
#define SEXT 369
#define FPTRUNC 370
#define FPEXT 371
#define BITCAST 372
#define UITOFP 373
#define SITOFP 374
#define FPTOUI 375
#define FPTOSI 376
#define INTTOPTR 377
#define PTRTOINT 378
#define PHI_TOK 379
#define SELECT 380
#define VAARG 381
#define EXTRACTELEMENT 382
#define INSERTELEMENT 383
#define SHUFFLEVECTOR 384
#define NORETURN 385
#define INREG 386
#define SRET 387
#define NOUNWIND 388
#define DEFAULT 389
#define HIDDEN 390
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 938 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
llvm::BasicBlock *BasicBlockVal;
@ -43,139 +360,14 @@ typedef union {
llvm::Instruction::OtherOps OtherOpVal;
llvm::ICmpInst::Predicate IPredicate;
llvm::FCmpInst::Predicate FPredicate;
} YYSTYPE;
#define ESINT64VAL 257
#define EUINT64VAL 258
#define ESAPINTVAL 259
#define EUAPINTVAL 260
#define LOCALVAL_ID 261
#define GLOBALVAL_ID 262
#define FPVAL 263
#define VOID 264
#define INTTYPE 265
#define FLOAT 266
#define DOUBLE 267
#define LABEL 268
#define TYPE 269
#define LOCALVAR 270
#define GLOBALVAR 271
#define LABELSTR 272
#define STRINGCONSTANT 273
#define ATSTRINGCONSTANT 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 THREAD_LOCAL 286
#define TO 287
#define DOTDOTDOT 288
#define NULL_TOK 289
#define UNDEF 290
#define INTERNAL 291
#define LINKONCE 292
#define WEAK 293
#define APPENDING 294
#define DLLIMPORT 295
#define DLLEXPORT 296
#define EXTERN_WEAK 297
#define OPAQUE 298
#define EXTERNAL 299
#define TARGET 300
#define TRIPLE 301
#define ALIGN 302
#define DEPLIBS 303
#define CALL 304
#define TAIL 305
#define ASM_TOK 306
#define MODULE 307
#define SIDEEFFECT 308
#define CC_TOK 309
#define CCC_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 SHL 334
#define LSHR 335
#define ASHR 336
#define ICMP 337
#define FCMP 338
#define EQ 339
#define NE 340
#define SLT 341
#define SGT 342
#define SLE 343
#define SGE 344
#define ULT 345
#define UGT 346
#define ULE 347
#define UGE 348
#define OEQ 349
#define ONE 350
#define OLT 351
#define OGT 352
#define OLE 353
#define OGE 354
#define ORD 355
#define UNO 356
#define UEQ 357
#define UNE 358
#define MALLOC 359
#define ALLOCA 360
#define FREE 361
#define LOAD 362
#define STORE 363
#define GETELEMENTPTR 364
#define TRUNC 365
#define ZEXT 366
#define SEXT 367
#define FPTRUNC 368
#define FPEXT 369
#define BITCAST 370
#define UITOFP 371
#define SITOFP 372
#define FPTOUI 373
#define FPTOSI 374
#define INTTOPTR 375
#define PTRTOINT 376
#define PHI_TOK 377
#define SELECT 378
#define VAARG 379
#define EXTRACTELEMENT 380
#define INSERTELEMENT 381
#define SHUFFLEVECTOR 382
#define NORETURN 383
#define INREG 384
#define SRET 385
#define NOUNWIND 386
#define DEFAULT 387
#define HIDDEN 388
}
/* Line 1489 of yacc.c. */
#line 366 "llvmAsmParser.tab.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE llvmAsmlval;

View File

@ -1004,6 +1004,7 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
%type <BoolVal> OptSideEffect // 'sideeffect' or not.
%type <Linkage> GVInternalLinkage GVExternalLinkage
%type <Linkage> FunctionDefineLinkage FunctionDeclareLinkage
%type <Linkage> AliasLinkage
%type <Visibility> GVVisibilityStyle
// ValueRef - Unresolved reference to a definition or BB
@ -1035,12 +1036,12 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
%token<StrVal> LOCALVAR GLOBALVAR LABELSTR STRINGCONSTANT ATSTRINGCONSTANT
%type <StrVal> LocalName OptLocalName OptLocalAssign
%type <StrVal> GlobalName OptGlobalAssign
%type <StrVal> GlobalName OptGlobalAssign GlobalAssign
%type <UIntVal> OptAlign OptCAlign
%type <StrVal> OptSection SectionString
%token ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK
%token DECLARE DEFINE GLOBAL CONSTANT SECTION VOLATILE THREAD_LOCAL
%token DECLARE DEFINE GLOBAL CONSTANT SECTION ALIAS VOLATILE THREAD_LOCAL
%token TO DOTDOTDOT NULL_TOK UNDEF INTERNAL LINKONCE WEAK APPENDING
%token DLLIMPORT DLLEXPORT EXTERN_WEAK
%token OPAQUE EXTERNAL TARGET TRIPLE ALIGN
@ -1136,15 +1137,17 @@ OptLocalAssign : LocalName '=' {
GlobalName : GLOBALVAR | ATSTRINGCONSTANT;
OptGlobalAssign : GlobalName '=' {
$$ = $1;
CHECK_FOR_ERROR
}
OptGlobalAssign : GlobalAssign
| /*empty*/ {
$$ = 0;
CHECK_FOR_ERROR
};
GlobalAssign : GlobalName '=' {
$$ = $1;
CHECK_FOR_ERROR
}
GVInternalLinkage
: INTERNAL { $$ = GlobalValue::InternalLinkage; }
| WEAK { $$ = GlobalValue::WeakLinkage; }
@ -1161,6 +1164,7 @@ GVExternalLinkage
GVVisibilityStyle
: /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
| DEFAULT { $$ = GlobalValue::DefaultVisibility; }
| HIDDEN { $$ = GlobalValue::HiddenVisibility; }
;
@ -1170,7 +1174,7 @@ FunctionDeclareLinkage
| EXTERN_WEAK { $$ = GlobalValue::ExternalWeakLinkage; }
;
FunctionDefineLinkage
FunctionDefineLinkage
: /*empty*/ { $$ = GlobalValue::ExternalLinkage; }
| INTERNAL { $$ = GlobalValue::InternalLinkage; }
| LINKONCE { $$ = GlobalValue::LinkOnceLinkage; }
@ -1178,6 +1182,12 @@ FunctionDefineLinkage
| DLLEXPORT { $$ = GlobalValue::DLLExportLinkage; }
;
AliasLinkage
: /*empty*/ { $$ = GlobalValue::ExternalLinkage; }
| WEAK { $$ = GlobalValue::WeakLinkage; }
| INTERNAL { $$ = GlobalValue::InternalLinkage; }
;
OptCallingConv : /*empty*/ { $$ = CallingConv::C; } |
CCC_TOK { $$ = CallingConv::C; } |
FASTCC_TOK { $$ = CallingConv::Fast; } |
@ -2031,6 +2041,34 @@ Definition
CurGV = 0;
CHECK_FOR_ERROR
}
| OptGlobalAssign GVVisibilityStyle ALIAS AliasLinkage ResultTypes SymbolicValueRef {
std::string Name($1);
if (Name.empty())
GEN_ERROR("Alias name cannot be empty")
const PointerType *PFTy = 0;
const FunctionType *Ty = 0;
Value* V = 0;
const Type* VTy = 0;
if (!(PFTy = dyn_cast<PointerType>($5->get())) ||
!(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
VTy = $5->get();
V = getExistingVal(VTy, $6);
} else {
VTy = PFTy;
V = getExistingVal(PFTy, $6);
}
if (V == 0)
GEN_ERROR(std::string("Invalid aliasee for alias: ") + $1);
GlobalValue* Aliasee;
if (Aliasee = dyn_cast<GlobalValue>(V)) {
GlobalAlias* GA = new GlobalAlias(VTy, $4, Name, Aliasee, CurModule.CurrentModule);
GA->setVisibility($2);
InsertValue(GA, CurModule.Values);
} else
GEN_ERROR("Aliases can be created only to global values");
CHECK_FOR_ERROR
delete $5;
}
| TARGET TargetDefinition {
CHECK_FOR_ERROR
}
@ -2196,9 +2234,9 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
// error.
GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
} else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
// Neither the existing or the current function is a declaration and they
// have the same name and same type. Clearly this is a redefinition.
GEN_ERROR("Redefinition of function '" + FunctionName + "'");
// Neither the existing or the current function is a declaration and they
// have the same name and same type. Clearly this is a redefinition.
GEN_ERROR("Redefinition of function '" + FunctionName + "'");
} if (Fn->isDeclaration()) {
// Make sure to strip off any argument names so we can't get conflicts.
for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
@ -2836,10 +2874,10 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
Ty = FunctionType::get($3->get(), ParamTypes, false, PAL);
PFTy = PointerType::get(Ty);
}
Value *V = getVal(PFTy, $4); // Get the function we're calling...
CHECK_FOR_ERROR
// Check for call to invalid intrinsic to avoid crashing later.
if (Function *theF = dyn_cast<Function>(V)) {
if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&