-/* A Bison parser, made from /Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y
+/* A Bison parser, made from /Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y
by GNU Bison version 1.28 */
#define YYBISON 1 /* Identify Bison output. */
#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 TYPE 274
-#define LABEL 275
-#define VAR_ID 276
-#define LABELSTR 277
-#define STRINGCONSTANT 278
-#define IMPLEMENTATION 279
-#define ZEROINITIALIZER 280
-#define TRUETOK 281
-#define FALSETOK 282
-#define BEGINTOK 283
-#define ENDTOK 284
-#define DECLARE 285
+#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 X86_FP80 268
+#define FP128 269
+#define PPC_FP128 270
+#define LABEL 271
+#define TYPE 272
+#define LOCALVAR 273
+#define GLOBALVAR 274
+#define LABELSTR 275
+#define STRINGCONSTANT 276
+#define ATSTRINGCONSTANT 277
+#define PCTSTRINGCONSTANT 278
+#define ZEROINITIALIZER 279
+#define TRUETOK 280
+#define FALSETOK 281
+#define BEGINTOK 282
+#define ENDTOK 283
+#define DECLARE 284
+#define DEFINE 285
#define GLOBAL 286
#define CONSTANT 287
#define SECTION 288
-#define VOLATILE 289
-#define TO 290
-#define DOTDOTDOT 291
-#define NULL_TOK 292
-#define UNDEF 293
-#define CONST 294
-#define INTERNAL 295
-#define LINKONCE 296
-#define WEAK 297
-#define APPENDING 298
-#define DLLIMPORT 299
-#define DLLEXPORT 300
-#define EXTERN_WEAK 301
-#define OPAQUE 302
-#define NOT 303
+#define ALIAS 289
+#define VOLATILE 290
+#define THREAD_LOCAL 291
+#define TO 292
+#define DOTDOTDOT 293
+#define NULL_TOK 294
+#define UNDEF 295
+#define INTERNAL 296
+#define LINKONCE 297
+#define WEAK 298
+#define APPENDING 299
+#define DLLIMPORT 300
+#define DLLEXPORT 301
+#define EXTERN_WEAK 302
+#define OPAQUE 303
#define EXTERNAL 304
#define TARGET 305
#define TRIPLE 306
-#define ENDIAN 307
-#define POINTERSIZE 308
-#define LITTLE 309
-#define BIG 310
-#define ALIGN 311
-#define DEPLIBS 312
-#define CALL 313
-#define TAIL 314
-#define ASM_TOK 315
-#define MODULE 316
-#define SIDEEFFECT 317
-#define CC_TOK 318
-#define CCC_TOK 319
-#define CSRETCC_TOK 320
-#define FASTCC_TOK 321
-#define COLDCC_TOK 322
-#define X86_STDCALLCC_TOK 323
-#define X86_FASTCALLCC_TOK 324
-#define DATA 325
-#define RET 326
-#define BR 327
-#define SWITCH 328
-#define INVOKE 329
-#define UNWIND 330
-#define UNREACHABLE 331
-#define ADD 332
-#define SUB 333
-#define MUL 334
-#define DIV 335
-#define REM 336
-#define AND 337
-#define OR 338
-#define XOR 339
-#define SETLE 340
-#define SETGE 341
-#define SETLT 342
-#define SETGT 343
-#define SETEQ 344
-#define SETNE 345
-#define MALLOC 346
-#define ALLOCA 347
-#define FREE 348
-#define LOAD 349
-#define STORE 350
-#define GETELEMENTPTR 351
-#define PHI_TOK 352
-#define CAST 353
-#define SELECT 354
-#define SHL 355
-#define SHR 356
-#define VAARG 357
-#define EXTRACTELEMENT 358
-#define INSERTELEMENT 359
-#define SHUFFLEVECTOR 360
-#define VAARG_old 361
-#define VANEXT_old 362
-
-#line 14 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+#define ALIGN 307
+#define DEPLIBS 308
+#define CALL 309
+#define TAIL 310
+#define ASM_TOK 311
+#define MODULE 312
+#define SIDEEFFECT 313
+#define CC_TOK 314
+#define CCC_TOK 315
+#define FASTCC_TOK 316
+#define COLDCC_TOK 317
+#define X86_STDCALLCC_TOK 318
+#define X86_FASTCALLCC_TOK 319
+#define DATALAYOUT 320
+#define RET 321
+#define BR 322
+#define SWITCH 323
+#define INVOKE 324
+#define UNWIND 325
+#define UNREACHABLE 326
+#define ADD 327
+#define SUB 328
+#define MUL 329
+#define UDIV 330
+#define SDIV 331
+#define FDIV 332
+#define UREM 333
+#define SREM 334
+#define FREM 335
+#define AND 336
+#define OR 337
+#define XOR 338
+#define SHL 339
+#define LSHR 340
+#define ASHR 341
+#define ICMP 342
+#define FCMP 343
+#define EQ 344
+#define NE 345
+#define SLT 346
+#define SGT 347
+#define SLE 348
+#define SGE 349
+#define ULT 350
+#define UGT 351
+#define ULE 352
+#define UGE 353
+#define OEQ 354
+#define ONE 355
+#define OLT 356
+#define OGT 357
+#define OLE 358
+#define OGE 359
+#define ORD 360
+#define UNO 361
+#define UEQ 362
+#define UNE 363
+#define MALLOC 364
+#define ALLOCA 365
+#define FREE 366
+#define LOAD 367
+#define STORE 368
+#define GETELEMENTPTR 369
+#define TRUNC 370
+#define ZEXT 371
+#define SEXT 372
+#define FPTRUNC 373
+#define FPEXT 374
+#define BITCAST 375
+#define UITOFP 376
+#define SITOFP 377
+#define FPTOUI 378
+#define FPTOSI 379
+#define INTTOPTR 380
+#define PTRTOINT 381
+#define PHI_TOK 382
+#define SELECT 383
+#define VAARG 384
+#define EXTRACTELEMENT 385
+#define INSERTELEMENT 386
+#define SHUFFLEVECTOR 387
+#define SIGNEXT 388
+#define ZEROEXT 389
+#define NORETURN 390
+#define INREG 391
+#define SRET 392
+#define NOUNWIND 393
+#define NOALIAS 394
+#define BYVAL 395
+#define NEST 396
+#define DEFAULT 397
+#define HIDDEN 398
+#define PROTECTED 399
+
+#line 14 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
#include "ParserInternals.h"
#include "llvm/CallingConv.h"
#include "llvm/InlineAsm.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
-#include "llvm/SymbolTable.h"
-#include "llvm/Assembly/AutoUpgrade.h"
+#include "llvm/ValueSymbolTable.h"
+#include "llvm/AutoUpgrade.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/Streams.h"
#include <algorithm>
-#include <iostream>
#include <list>
+#include <map>
#include <utility>
+#ifndef NDEBUG
+#define YYDEBUG 1
+#endif
// The following is a gross hack. In order to rid the libAsmParser library of
// exceptions, we have to have a way of getting the yyparse function to go into
namespace llvm {
std::string CurFilename;
+#if YYDEBUG
+static cl::opt<bool>
+Debug("debug-yacc", cl::desc("Print yacc debug state changes"),
+ cl::Hidden, cl::init(false));
+#endif
}
using namespace llvm;
//
//#define DEBUG_UPREFS 1
#ifdef DEBUG_UPREFS
-#define UR_OUT(X) std::cerr << X
+#define UR_OUT(X) cerr << X
#else
#define UR_OUT(X)
#endif
#define YYERROR_VERBOSE 1
-static bool ObsoleteVarArgs;
-static bool NewVarArgs;
-static BasicBlock *CurBB;
static GlobalVariable *CurGV;
// destroyed when the function is completed.
//
typedef std::vector<Value *> ValueList; // Numbered defs
+
static void
-ResolveDefinitions(std::map<const Type *,ValueList> &LateResolvers,
- std::map<const Type *,ValueList> *FutureLateResolvers = 0);
+ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
static struct PerModuleInfo {
Module *CurrentModule;
- std::map<const Type *, ValueList> Values; // Module level numbered definitions
- std::map<const Type *,ValueList> LateResolveValues;
+ ValueList Values; // Module level numbered definitions
+ ValueList LateResolveValues;
std::vector<PATypeHolder> Types;
std::map<ValID, PATypeHolder> LateResolveTypes;
// Look for intrinsic functions and CallInst that need to be upgraded
for (Module::iterator FI = CurrentModule->begin(),
FE = CurrentModule->end(); FI != FE; )
- UpgradeCallsToIntrinsic(FI++);
+ UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
Values.clear(); // Clear out function local definitions
Types.clear();
}
return Ret;
}
+
+ bool TypeIsUnresolved(PATypeHolder* PATy) {
+ // If it isn't abstract, its resolved
+ const Type* Ty = PATy->get();
+ if (!Ty->isAbstract())
+ return false;
+ // Traverse the type looking for abstract types. If it isn't abstract then
+ // we don't need to traverse that leg of the type.
+ std::vector<const Type*> WorkList, SeenList;
+ WorkList.push_back(Ty);
+ while (!WorkList.empty()) {
+ const Type* Ty = WorkList.back();
+ SeenList.push_back(Ty);
+ WorkList.pop_back();
+ if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
+ // Check to see if this is an unresolved type
+ std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
+ std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
+ for ( ; I != E; ++I) {
+ if (I->second.get() == OpTy)
+ return true;
+ }
+ } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
+ const Type* TheTy = SeqTy->getElementType();
+ if (TheTy->isAbstract() && TheTy != Ty) {
+ std::vector<const Type*>::iterator I = SeenList.begin(),
+ E = SeenList.end();
+ for ( ; I != E; ++I)
+ if (*I == TheTy)
+ break;
+ if (I == E)
+ WorkList.push_back(TheTy);
+ }
+ } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
+ for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
+ const Type* TheTy = StrTy->getElementType(i);
+ if (TheTy->isAbstract() && TheTy != Ty) {
+ std::vector<const Type*>::iterator I = SeenList.begin(),
+ E = SeenList.end();
+ for ( ; I != E; ++I)
+ if (*I == TheTy)
+ break;
+ if (I == E)
+ WorkList.push_back(TheTy);
+ }
+ }
+ }
+ }
+ return false;
+ }
} CurModule;
static struct PerFunctionInfo {
Function *CurrentFunction; // Pointer to current function being created
- std::map<const Type*, ValueList> Values; // Keep track of #'d definitions
- std::map<const Type*, ValueList> LateResolveValues;
- bool isDeclare; // Is this function a forward declararation?
+ ValueList Values; // Keep track of #'d definitions
+ unsigned NextValNum;
+ ValueList LateResolveValues;
+ bool isDeclare; // Is this function a forward declararation?
GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
+ GlobalValue::VisibilityTypes Visibility;
/// BBForwardRefs - When we see forward references to basic blocks, keep
/// track of them here.
- std::map<BasicBlock*, std::pair<ValID, int> > BBForwardRefs;
- std::vector<BasicBlock*> NumberedBlocks;
- unsigned NextBBNum;
+ std::map<ValID, BasicBlock*> BBForwardRefs;
inline PerFunctionInfo() {
CurrentFunction = 0;
isDeclare = false;
- Linkage = GlobalValue::ExternalLinkage;
+ Linkage = GlobalValue::ExternalLinkage;
+ Visibility = GlobalValue::DefaultVisibility;
}
inline void FunctionStart(Function *M) {
CurrentFunction = M;
- NextBBNum = 0;
+ NextValNum = 0;
}
void FunctionDone() {
- NumberedBlocks.clear();
-
// Any forward referenced blocks left?
if (!BBForwardRefs.empty()) {
GenerateError("Undefined reference to label " +
- BBForwardRefs.begin()->first->getName());
+ BBForwardRefs.begin()->second->getName());
return;
}
ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
Values.clear(); // Clear out function local definitions
+ BBForwardRefs.clear();
CurrentFunction = 0;
isDeclare = false;
Linkage = GlobalValue::ExternalLinkage;
+ Visibility = GlobalValue::DefaultVisibility;
}
} CurFun; // Info for the current function...
// Code to handle definitions of all the types
//===----------------------------------------------------------------------===//
-static int InsertValue(Value *V,
- std::map<const Type*,ValueList> &ValueTab = CurFun.Values) {
- if (V->hasName()) return -1; // Is this a numbered definition?
-
- // Yes, insert the value into the value table...
- ValueList &List = ValueTab[V->getType()];
- List.push_back(V);
- return List.size()-1;
+static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
+ // Things that have names or are void typed don't get slot numbers
+ if (V->hasName() || (V->getType() == Type::VoidTy))
+ return;
+
+ // In the case of function values, we have to allow for the forward reference
+ // of basic blocks, which are included in the numbering. Consequently, we keep
+ // track of the next insertion location with NextValNum. When a BB gets
+ // inserted, it could change the size of the CurFun.Values vector.
+ if (&ValueTab == &CurFun.Values) {
+ if (ValueTab.size() <= CurFun.NextValNum)
+ ValueTab.resize(CurFun.NextValNum+1);
+ ValueTab[CurFun.NextValNum++] = V;
+ return;
+ }
+ // For all other lists, its okay to just tack it on the back of the vector.
+ ValueTab.push_back(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?
- if (const Type *N = CurModule.CurrentModule->getTypeByName(D.Name)) {
+ case ValID::LocalName: // Is it a named definition?
+ if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
D.destroy(); // Free old strdup'd memory...
return N;
}
break;
default:
- GenerateError("Internal parser error: Invalid symbol type reference!");
+ GenerateError("Internal parser error: Invalid symbol type reference");
return 0;
}
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;
}
}
return Typ;
}
-static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) {
- SymbolTable &SymTab =
- inFunctionScope() ? CurFun.CurrentFunction->getSymbolTable() :
- CurModule.CurrentModule->getSymbolTable();
- return SymTab.lookup(Ty, Name);
-}
-
-// getValNonImprovising - Look up the value specified by the provided type and
+// getExistingVal - 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.
//
-static Value *getValNonImprovising(const Type *Ty, const ValID &D) {
+static Value *getExistingVal(const Type *Ty, const ValID &D) {
if (isa<FunctionType>(Ty)) {
GenerateError("Functions are not values and "
"must be referenced as pointers");
}
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();
+ case ValID::LocalID: { // Is it a numbered definition?
+ // Check that the number is within bounds.
+ if (D.Num >= CurFun.Values.size())
+ return 0;
+ Value *Result = CurFun.Values[D.Num];
+ if (Ty != Result->getType()) {
+ GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
+ Result->getType()->getDescription() + "' does not match "
+ "expected type, '" + Ty->getDescription() + "'");
+ return 0;
}
-
- // Make sure that our type is within bounds
- VI = CurFun.Values.find(Ty);
- if (VI == CurFun.Values.end()) return 0;
-
- // Check that the number is within bounds...
- if (VI->second.size() <= Num) return 0;
-
- return VI->second[Num];
+ return Result;
}
-
- case ValID::NameVal: { // Is it a named definition?
- Value *N = lookupInSymbolTable(Ty, std::string(D.Name));
- if (N == 0) return 0;
+ case ValID::GlobalID: { // Is it a numbered definition?
+ if (D.Num >= CurModule.Values.size())
+ return 0;
+ Value *Result = CurModule.Values[D.Num];
+ if (Ty != Result->getType()) {
+ GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
+ Result->getType()->getDescription() + "' does not match "
+ "expected type, '" + Ty->getDescription() + "'");
+ return 0;
+ }
+ return Result;
+ }
+
+ case ValID::LocalName: { // Is it a named definition?
+ if (!inFunctionScope())
+ return 0;
+ ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
+ Value *N = SymTab.lookup(D.getName());
+ if (N == 0)
+ return 0;
+ if (N->getType() != Ty)
+ return 0;
+
+ D.destroy(); // Free old strdup'd memory...
+ return N;
+ }
+ case ValID::GlobalName: { // Is it a named definition?
+ ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
+ Value *N = SymTab.lookup(D.getName());
+ if (N == 0)
+ return 0;
+ if (N->getType() != Ty)
+ return 0;
D.destroy(); // Free old strdup'd memory...
return N;
// Check to make sure that "Ty" is an integral type, and that our
// value will fit into the specified type...
case ValID::ConstSIntVal: // Is it a constant pool reference??
- if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64)) {
+ if (!ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
GenerateError("Signed integral constant '" +
itostr(D.ConstPool64) + "' is invalid for type '" +
- Ty->getDescription() + "'!");
+ Ty->getDescription() + "'");
return 0;
}
- return ConstantSInt::get(Ty, D.ConstPool64);
+ return ConstantInt::get(Ty, D.ConstPool64, true);
case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
- if (!ConstantUInt::isValueValidForType(Ty, D.UConstPool64)) {
- if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64)) {
+ if (!ConstantInt::isValueValidForType(Ty, D.UConstPool64)) {
+ if (!ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
GenerateError("Integral constant '" + utostr(D.UConstPool64) +
- "' is invalid or out of range!");
+ "' is invalid or out of range");
return 0;
} else { // This is really a signed reference. Transmogrify.
- return ConstantSInt::get(Ty, D.ConstPool64);
+ return ConstantInt::get(Ty, D.ConstPool64, true);
}
} else {
- return ConstantUInt::get(Ty, D.UConstPool64);
+ return ConstantInt::get(Ty, D.UConstPool64);
}
case ValID::ConstFPVal: // Is it a floating point const pool reference?
- if (!ConstantFP::isValueValidForType(Ty, D.ConstPoolFP)) {
- GenerateError("FP constant invalid for type!!");
+ if (!ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
+ GenerateError("FP constant invalid for type");
return 0;
}
- return ConstantFP::get(Ty, D.ConstPoolFP);
+ // Lexer has no type info, so builds all float and double FP constants
+ // as double. Fix this here. Long double does not need this.
+ if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
+ Ty==Type::FloatTy)
+ D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
+ return ConstantFP::get(Ty, *D.ConstPoolFP);
case ValID::ConstNullVal: // Is it a null value?
if (!isa<PointerType>(Ty)) {
- GenerateError("Cannot create a a non pointer null!");
+ GenerateError("Cannot create a a non pointer null");
return 0;
}
return ConstantPointerNull::get(cast<PointerType>(Ty));
case ValID::ConstantVal: // Fully resolved constant?
if (D.ConstantValue->getType() != Ty) {
- GenerateError("Constant expression type different from required type!");
+ GenerateError("Constant expression type different from required type");
return 0;
}
return D.ConstantValue;
const FunctionType *FTy =
PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
- GenerateError("Invalid type for asm constraint string!");
+ GenerateError("Invalid type for asm constraint string");
return 0;
}
InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
return 0;
}
-// getVal - This function is identical to getValNonImprovising, except that if a
+// getVal - This function is identical to getExistingVal, except that if a
// value is not already defined, it "improvises" by creating a placeholder var
// that looks and acts just like the requested variable. When the value is
// defined later, all uses of the placeholder variable are replaced with the
}
// See if the value has already been defined.
- Value *V = getValNonImprovising(Ty, ID);
+ Value *V = getExistingVal(Ty, ID);
if (V) return V;
if (TriggerError) return 0;
if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
- GenerateError("Invalid use of a composite type!");
+ GenerateError("Invalid use of a composite type");
return 0;
}
// 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...
//
- V = new Argument(Ty);
-
+ switch (ID.Type) {
+ case ValID::GlobalName:
+ case ValID::GlobalID: {
+ const PointerType *PTy = dyn_cast<PointerType>(Ty);
+ if (!PTy) {
+ GenerateError("Invalid type for reference to global" );
+ return 0;
+ }
+ const Type* ElTy = PTy->getElementType();
+ if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
+ V = new Function(FTy, GlobalValue::ExternalLinkage);
+ else
+ V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage);
+ break;
+ }
+ default:
+ V = new Argument(Ty);
+ }
+
// Remember where this forward reference came from. FIXME, shouldn't we try
// to recycle these things??
CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
return V;
}
-/// getBBVal - This is used for two purposes:
-/// * If isDefinition is true, a new basic block with the specified ID is being
-/// defined.
-/// * If isDefinition is true, this is a reference to a basic block, which may
-/// or may not be a forward reference.
-///
-static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
+/// defineBBVal - This is a definition of a new basic block with the specified
+/// identifier which must be the same as CurFun.NextValNum, if its numeric.
+static BasicBlock *defineBBVal(const ValID &ID) {
assert(inFunctionScope() && "Can't get basic block at global scope!");
- std::string Name;
BasicBlock *BB = 0;
- switch (ID.Type) {
- default:
- GenerateError("Illegal label reference " + ID.getName());
- return 0;
- case ValID::NumberVal: // Is it a numbered definition?
- if (unsigned(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?
- Name = ID.Name;
- if (Value *N = CurFun.CurrentFunction->
- getSymbolTable().lookup(Type::LabelTy, Name))
- BB = cast<BasicBlock>(N);
- break;
- }
- // See if the block has already been defined.
- if (BB) {
- // If this is the definition of the block, make sure the existing value was
- // just a forward reference. If it was a forward reference, there will be
- // an entry for it in the PlaceHolderInfo map.
- if (isDefinition && !CurFun.BBForwardRefs.erase(BB)) {
- // The existing value was a definition, not a forward reference.
- GenerateError("Redefinition of label " + ID.getName());
- return 0;
+ // First, see if this was forward referenced
+
+ std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
+ if (BBI != CurFun.BBForwardRefs.end()) {
+ BB = BBI->second;
+ // The forward declaration could have been inserted anywhere in the
+ // function: insert it into the correct place now.
+ CurFun.CurrentFunction->getBasicBlockList().remove(BB);
+ CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
+
+ // We're about to erase the entry, save the key so we can clean it up.
+ ValID Tmp = BBI->first;
+
+ // Erase the forward ref from the map as its no longer "forward"
+ CurFun.BBForwardRefs.erase(ID);
+
+ // The key has been removed from the map but so we don't want to leave
+ // strdup'd memory around so destroy it too.
+ Tmp.destroy();
+
+ // If its a numbered definition, bump the number and set the BB value.
+ if (ID.Type == ValID::LocalID) {
+ assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
+ InsertValue(BB);
}
- ID.destroy(); // Free strdup'd memory.
+ ID.destroy();
return BB;
+ }
+
+ // We haven't seen this BB before and its first mention is a definition.
+ // Just create it and return it.
+ std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
+ BB = new BasicBlock(Name, CurFun.CurrentFunction);
+ if (ID.Type == ValID::LocalID) {
+ assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
+ InsertValue(BB);
}
- // Otherwise this block has not been seen before.
- BB = new BasicBlock("", CurFun.CurrentFunction);
- if (ID.Type == ValID::NameVal) {
- BB->setName(ID.Name);
+ ID.destroy(); // Free strdup'd memory
+ return BB;
+}
+
+/// getBBVal - get an existing BB value or create a forward reference for it.
+///
+static BasicBlock *getBBVal(const ValID &ID) {
+ assert(inFunctionScope() && "Can't get basic block at global scope!");
+
+ BasicBlock *BB = 0;
+
+ std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
+ if (BBI != CurFun.BBForwardRefs.end()) {
+ BB = BBI->second;
+ } if (ID.Type == ValID::LocalName) {
+ std::string Name = ID.getName();
+ Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
+ if (N)
+ if (N->getType()->getTypeID() == Type::LabelTyID)
+ BB = cast<BasicBlock>(N);
+ else
+ GenerateError("Reference to label '" + Name + "' is actually of type '"+
+ N->getType()->getDescription() + "'");
+ } else if (ID.Type == ValID::LocalID) {
+ if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
+ if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
+ BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
+ else
+ GenerateError("Reference to label '%" + utostr(ID.Num) +
+ "' is actually of type '"+
+ CurFun.Values[ID.Num]->getType()->getDescription() + "'");
+ }
} else {
- CurFun.NumberedBlocks[ID.Num] = BB;
+ GenerateError("Illegal label reference " + ID.getName());
+ return 0;
}
- // If this is not a definition, keep track of it so we can use it as a forward
- // reference.
- if (!isDefinition) {
- // Remember where this forward reference came from.
- CurFun.BBForwardRefs[BB] = std::make_pair(ID, llvmAsmlineno);
- } else {
- // The forward declaration could have been inserted anywhere in the
- // function: insert it into the correct place now.
- CurFun.CurrentFunction->getBasicBlockList().remove(BB);
- CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
+ // If its already been defined, return it now.
+ if (BB) {
+ ID.destroy(); // Free strdup'd memory.
+ return BB;
}
- ID.destroy();
+
+ // Otherwise, this block has not been seen before, create it.
+ std::string Name;
+ if (ID.Type == ValID::LocalName)
+ Name = ID.getName();
+ BB = new BasicBlock(Name, CurFun.CurrentFunction);
+
+ // Insert it in the forward refs map.
+ CurFun.BBForwardRefs[ID] = BB;
+
return BB;
}
// defs now...
//
static void
-ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers,
- std::map<const Type*,ValueList> *FutureLateResolvers) {
+ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
// Loop over LateResolveDefs fixing up stuff that couldn't be resolved
- for (std::map<const Type*,ValueList>::iterator LRI = LateResolvers.begin(),
- E = LateResolvers.end(); LRI != E; ++LRI) {
- ValueList &List = LRI->second;
- while (!List.empty()) {
- Value *V = List.back();
- List.pop_back();
+ while (!LateResolvers.empty()) {
+ Value *V = LateResolvers.back();
+ LateResolvers.pop_back();
- std::map<Value*, std::pair<ValID, int> >::iterator PHI =
- CurModule.PlaceHolderInfo.find(V);
- assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
+ std::map<Value*, std::pair<ValID, int> >::iterator PHI =
+ CurModule.PlaceHolderInfo.find(V);
+ assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
- ValID &DID = PHI->second.first;
+ ValID &DID = PHI->second.first;
- Value *TheRealValue = getValNonImprovising(LRI->first, DID);
- if (TriggerError)
+ Value *TheRealValue = getExistingVal(V->getType(), DID);
+ if (TriggerError)
+ return;
+ if (TheRealValue) {
+ V->replaceAllUsesWith(TheRealValue);
+ delete V;
+ CurModule.PlaceHolderInfo.erase(PHI);
+ } else if (FutureLateResolvers) {
+ // Functions have their unresolved items forwarded to the module late
+ // resolver table
+ InsertValue(V, *FutureLateResolvers);
+ } else {
+ 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);
return;
- if (TheRealValue) {
- V->replaceAllUsesWith(TheRealValue);
- delete V;
- CurModule.PlaceHolderInfo.erase(PHI);
- } else if (FutureLateResolvers) {
- // Functions have their unresolved items forwarded to the module late
- // resolver table
- InsertValue(V, *FutureLateResolvers);
} else {
- if (DID.Type == ValID::NameVal) {
- GenerateError("Reference to an invalid definition: '" +DID.getName()+
- "' of type '" + V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
- } else {
- GenerateError("Reference to an invalid definition: #" +
- itostr(DID.Num) + " of type '" +
- V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
- }
+ GenerateError("Reference to an invalid definition: #" +
+ itostr(DID.Num) + " of type '" +
+ V->getType()->getDescription() + "'",
+ PHI->second.second);
+ return;
}
}
}
-
LateResolvers.clear();
}
// name is not null) things referencing Name can be resolved. Otherwise, things
// refering to the number can be resolved. Do this now.
//
-static void ResolveTypeTo(char *Name, const Type *ToTy) {
+static void ResolveTypeTo(std::string *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);
// null potentially, in which case this is a noop. The string passed in is
// 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;
- }
-
- assert(inFunctionScope() && "Must be in function scope!");
- SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable();
- if (ST.lookup(V->getType(), Name)) {
- GenerateError("Redefinition of value named '" + Name + "' in the '" +
- V->getType()->getDescription() + "' type plane!");
- return;
- }
+static void setValueName(Value *V, std::string *NameStr) {
+ if (!NameStr) return;
+ std::string Name(*NameStr); // Copy string
+ delete NameStr; // Free old string
+
+ 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!");
+ ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
+ if (ST.lookup(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,
/// this is a declaration, otherwise it is a definition.
static GlobalVariable *
-ParseGlobalVariable(char *NameStr,GlobalValue::LinkageTypes Linkage,
+ParseGlobalVariable(std::string *NameStr,
+ GlobalValue::LinkageTypes Linkage,
+ GlobalValue::VisibilityTypes Visibility,
bool isConstantGlobal, const Type *Ty,
- Constant *Initializer) {
+ Constant *Initializer, bool IsThreadLocal) {
if (isa<FunctionType>(Ty)) {
- GenerateError("Cannot declare global vars of function type!");
+ GenerateError("Cannot declare global vars of function type");
return 0;
}
std::string Name;
if (NameStr) {
- Name = NameStr; // Copy string
- free(NameStr); // Free old string
+ Name = *NameStr; // Copy string
+ delete NameStr; // Free old string
}
// See if this global value was forward referenced. If so, recycle the
// object.
ValID ID;
if (!Name.empty()) {
- ID = ValID::create((char*)Name.c_str());
+ ID = ValID::createGlobalName(Name);
} else {
- ID = ValID::create((int)CurModule.Values[PTy].size());
+ ID = ValID::createGlobalID(CurModule.Values.size());
}
if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
CurModule.CurrentModule->getGlobalList().push_back(GV);
GV->setInitializer(Initializer);
GV->setLinkage(Linkage);
+ GV->setVisibility(Visibility);
GV->setConstant(isConstantGlobal);
+ GV->setThreadLocal(IsThreadLocal);
InsertValue(GV, CurModule.Values);
return GV;
}
- // If this global has a name, check to see if there is already a definition
- // of this global in the module. If so, merge as appropriate. Note that
- // this is really just a hack around problems in the CFE. :(
+ // If this global has a name
if (!Name.empty()) {
- // We are a simple redefinition of a value, check to see if it is defined
- // the same as the old one.
- if (GlobalVariable *EGV =
- CurModule.CurrentModule->getGlobalVariable(Name, Ty)) {
- // We are allowed to redefine a global variable in two circumstances:
- // 1. If at least one of the globals is uninitialized or
- // 2. If both initializers have the same value.
- //
- if (!EGV->hasInitializer() || !Initializer ||
- EGV->getInitializer() == Initializer) {
-
- // Make sure the existing global version gets the initializer! Make
- // sure that it also gets marked const if the new version is.
- if (Initializer && !EGV->hasInitializer())
- EGV->setInitializer(Initializer);
- if (isConstantGlobal)
- EGV->setConstant(true);
- EGV->setLinkage(Linkage);
- return EGV;
+ // if the global we're parsing has an initializer (is a definition) and
+ // has external linkage.
+ if (Initializer && Linkage != GlobalValue::InternalLinkage)
+ // If there is already a global with external linkage with this name
+ if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
+ // If we allow this GVar to get created, it will be renamed in the
+ // symbol table because it conflicts with an existing GVar. We can't
+ // allow redefinition of GVars whose linking indicates that their name
+ // must stay the same. Issue the error.
+ GenerateError("Redefinition of global variable named '" + Name +
+ "' of type '" + Ty->getDescription() + "'");
+ return 0;
}
-
- GenerateError("Redefinition of global variable named '" + Name +
- "' in the '" + Ty->getDescription() + "' type plane!");
- return 0;
- }
}
// Otherwise there is no existing GV to use, create one now.
GlobalVariable *GV =
new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
- CurModule.CurrentModule);
+ CurModule.CurrentModule, IsThreadLocal);
+ GV->setVisibility(Visibility);
InsertValue(GV, CurModule.Values);
return GV;
}
// This function returns true if the type has already been defined, but is
// allowed to be redefined in the specified context. If the name is a new name
// for the type plane, it is inserted and false is returned.
-static bool setTypeName(const Type *T, char *NameStr) {
+static bool setTypeName(const Type *T, std::string *NameStr) {
assert(!inFunctionScope() && "Can't give types function-local names!");
if (NameStr == 0) return false;
- std::string Name(NameStr); // Copy string
- free(NameStr); // Free old string
+ std::string Name(*NameStr); // Copy string
+ delete NameStr; // Free old string
// We don't allow assigning names to void type
if (T == Type::VoidTy) {
- GenerateError("Can't assign name '" + Name + "' to the void type!");
+ GenerateError("Can't assign name '" + Name + "' to the void type");
return false;
}
if (AlreadyExists) { // Inserting a name that is already defined???
const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
- assert(Existing && "Conflict but no matching type?");
+ assert(Existing && "Conflict but no matching type?!");
// There is only one case where this is allowed: when we are refining an
// opaque type. In this case, Existing will be an opaque type.
if (Existing == T) return true; // Yes, it's equal.
// Any other kind of (non-equivalent) redefinition is an error.
- GenerateError("Redefinition of type named '" + Name + "' in the '" +
- T->getDescription() + "' type plane!");
+ GenerateError("Redefinition of type named '" + Name + "' of type '" +
+ T->getDescription() + "'");
}
return false;
return Ty;
}
-
-// common code from the two 'RunVMAsmParser' functions
-static Module* RunParser(Module * M) {
-
- llvmAsmlineno = 1; // Reset the current line number...
- ObsoleteVarArgs = false;
- NewVarArgs = false;
- CurModule.CurrentModule = M;
-
- // Check to make sure the parser succeeded
- if (yyparse()) {
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
-
- // Check to make sure that parsing produced a result
- if (!ParserResult)
- return 0;
-
- // Reset ParserResult variable while saving its value for the result.
- Module *Result = ParserResult;
- ParserResult = 0;
-
- //Not all functions use vaarg, so make a second check for ObsoleteVarArgs
- {
- Function* F;
- if ((F = Result->getNamedFunction("llvm.va_start"))
- && F->getFunctionType()->getNumParams() == 0)
- ObsoleteVarArgs = true;
- if((F = Result->getNamedFunction("llvm.va_copy"))
- && F->getFunctionType()->getNumParams() == 1)
- ObsoleteVarArgs = true;
- }
-
- if (ObsoleteVarArgs && NewVarArgs) {
- GenerateError(
- "This file is corrupt: it uses both new and old style varargs");
- return 0;
- }
-
- if(ObsoleteVarArgs) {
- if(Function* F = Result->getNamedFunction("llvm.va_start")) {
- if (F->arg_size() != 0) {
- GenerateError("Obsolete va_start takes 0 argument!");
- return 0;
- }
-
- //foo = va_start()
- // ->
- //bar = alloca typeof(foo)
- //va_start(bar)
- //foo = load bar
-
- const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
- const Type* ArgTy = F->getFunctionType()->getReturnType();
- const Type* ArgTyPtr = PointerType::get(ArgTy);
- Function* NF = Result->getOrInsertFunction("llvm.va_start",
- RetTy, ArgTyPtr, (Type *)0);
-
- while (!F->use_empty()) {
- CallInst* CI = cast<CallInst>(F->use_back());
- AllocaInst* bar = new AllocaInst(ArgTy, 0, "vastart.fix.1", CI);
- new CallInst(NF, bar, "", CI);
- Value* foo = new LoadInst(bar, "vastart.fix.2", CI);
- CI->replaceAllUsesWith(foo);
- CI->getParent()->getInstList().erase(CI);
- }
- Result->getFunctionList().erase(F);
- }
-
- if(Function* F = Result->getNamedFunction("llvm.va_end")) {
- if(F->arg_size() != 1) {
- GenerateError("Obsolete va_end takes 1 argument!");
- return 0;
- }
-
- //vaend foo
- // ->
- //bar = alloca 1 of typeof(foo)
- //vaend bar
- const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
- const Type* ArgTy = F->getFunctionType()->getParamType(0);
- const Type* ArgTyPtr = PointerType::get(ArgTy);
- Function* NF = Result->getOrInsertFunction("llvm.va_end",
- RetTy, ArgTyPtr, (Type *)0);
-
- while (!F->use_empty()) {
- CallInst* CI = cast<CallInst>(F->use_back());
- AllocaInst* bar = new AllocaInst(ArgTy, 0, "vaend.fix.1", CI);
- new StoreInst(CI->getOperand(1), bar, CI);
- new CallInst(NF, bar, "", CI);
- CI->getParent()->getInstList().erase(CI);
- }
- Result->getFunctionList().erase(F);
- }
-
- if(Function* F = Result->getNamedFunction("llvm.va_copy")) {
- if(F->arg_size() != 1) {
- GenerateError("Obsolete va_copy takes 1 argument!");
- return 0;
- }
- //foo = vacopy(bar)
- // ->
- //a = alloca 1 of typeof(foo)
- //b = alloca 1 of typeof(foo)
- //store bar -> b
- //vacopy(a, b)
- //foo = load a
-
- const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
- const Type* ArgTy = F->getFunctionType()->getReturnType();
- const Type* ArgTyPtr = PointerType::get(ArgTy);
- Function* NF = Result->getOrInsertFunction("llvm.va_copy",
- RetTy, ArgTyPtr, ArgTyPtr,
- (Type *)0);
-
- while (!F->use_empty()) {
- CallInst* CI = cast<CallInst>(F->use_back());
- AllocaInst* a = new AllocaInst(ArgTy, 0, "vacopy.fix.1", CI);
- AllocaInst* b = new AllocaInst(ArgTy, 0, "vacopy.fix.2", CI);
- new StoreInst(CI->getOperand(1), b, CI);
- new CallInst(NF, a, b, "", CI);
- Value* foo = new LoadInst(a, "vacopy.fix.3", CI);
- CI->replaceAllUsesWith(foo);
- CI->getParent()->getInstList().erase(CI);
- }
- Result->getFunctionList().erase(F);
- }
- }
-
- return Result;
-}
-
//===----------------------------------------------------------------------===//
// RunVMAsmParser - Define an interface to this parser
//===----------------------------------------------------------------------===//
//
+static Module* RunParser(Module * M);
+
Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
set_scan_file(F);
}
-#line 974 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 968 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
typedef union {
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
- std::pair<llvm::PATypeHolder*, char*> *ArgVal;
llvm::BasicBlock *BasicBlockVal;
llvm::TerminatorInst *TermInstVal;
llvm::Instruction *InstVal;
llvm::Constant *ConstVal;
const llvm::Type *PrimType;
+ std::list<llvm::PATypeHolder> *TypeList;
llvm::PATypeHolder *TypeVal;
llvm::Value *ValueVal;
-
- std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList;
std::vector<llvm::Value*> *ValueList;
- std::list<llvm::PATypeHolder> *TypeList;
+ llvm::ArgListType *ArgList;
+ llvm::TypeWithAttrs TypeWithAttrs;
+ llvm::TypeWithAttrsList *TypeWithAttrsList;
+ llvm::ParamList *ParamList;
+
// Represent the RHS of PHI node
std::list<std::pair<llvm::Value*,
llvm::BasicBlock*> > *PHIList;
std::vector<llvm::Constant*> *ConstVector;
llvm::GlobalValue::LinkageTypes Linkage;
+ llvm::GlobalValue::VisibilityTypes Visibility;
+ uint16_t ParamAttrs;
+ llvm::APInt *APIntVal;
int64_t SInt64Val;
uint64_t UInt64Val;
int SIntVal;
unsigned UIntVal;
- double FPVal;
+ llvm::APFloat *FPVal;
bool BoolVal;
- char *StrVal; // This memory is strdup'd!
- llvm::ValID ValIDVal; // strdup'd memory maybe!
+ std::string *StrVal; // This memory must be deleted
+ llvm::ValID ValIDVal;
- llvm::Instruction::BinaryOps BinaryOpVal;
- llvm::Instruction::TermOps TermOpVal;
- llvm::Instruction::MemoryOps MemOpVal;
- llvm::Instruction::OtherOps OtherOpVal;
- llvm::Module::Endianness Endianness;
+ llvm::Instruction::BinaryOps BinaryOpVal;
+ llvm::Instruction::TermOps TermOpVal;
+ llvm::Instruction::MemoryOps MemOpVal;
+ llvm::Instruction::CastOps CastOpVal;
+ llvm::Instruction::OtherOps OtherOpVal;
+ llvm::ICmpInst::Predicate IPredicate;
+ llvm::FCmpInst::Predicate FPredicate;
} YYSTYPE;
#include <stdio.h>
-#define YYFINAL 517
+#define YYFINAL 600
#define YYFLAG -32768
-#define YYNTBASE 123
+#define YYNTBASE 160
-#define YYTRANSLATE(x) ((unsigned)(x) <= 362 ? yytranslate[x] : 197)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 399 ? yytranslate[x] : 241)
-static const char yytranslate[] = { 0,
+static const short 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, 112,
- 113, 121, 2, 110, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 117,
- 109, 118, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 150,
+ 151, 148, 2, 147, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 155,
+ 146, 156, 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,
- 114, 111, 116, 2, 2, 2, 2, 2, 122, 2,
+ 152, 149, 154, 2, 2, 2, 2, 2, 159, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 115,
- 2, 2, 119, 2, 120, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 153,
+ 2, 2, 157, 2, 158, 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,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- 107, 108
+ 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, 133, 134, 135, 136,
+ 137, 138, 139, 140, 141, 142, 143, 144, 145
};
#if YYDEBUG != 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, 67, 68, 70, 72, 74, 76, 78,
- 80, 82, 83, 84, 86, 88, 90, 92, 94, 96,
- 99, 100, 103, 104, 108, 111, 112, 114, 115, 119,
- 121, 124, 126, 128, 130, 132, 134, 136, 138, 140,
- 142, 144, 146, 148, 150, 152, 154, 156, 158, 160,
- 162, 164, 166, 169, 174, 180, 186, 190, 193, 196,
- 198, 202, 204, 208, 210, 211, 216, 220, 224, 229,
- 234, 238, 241, 244, 247, 250, 253, 256, 259, 262,
- 265, 268, 275, 281, 290, 297, 304, 311, 318, 325,
- 334, 343, 347, 349, 351, 353, 355, 358, 361, 366,
- 369, 371, 376, 379, 384, 385, 393, 394, 402, 403,
- 411, 412, 420, 424, 429, 430, 432, 434, 436, 440,
- 444, 448, 452, 456, 460, 462, 463, 465, 467, 469,
- 470, 473, 477, 479, 481, 485, 487, 488, 497, 499,
- 501, 505, 507, 509, 512, 513, 515, 517, 518, 523,
- 524, 526, 528, 530, 532, 534, 536, 538, 540, 542,
- 546, 548, 554, 556, 558, 560, 562, 565, 568, 571,
- 575, 578, 579, 581, 584, 587, 591, 601, 611, 620,
- 634, 636, 638, 645, 651, 654, 661, 669, 671, 675,
- 677, 678, 681, 683, 689, 695, 701, 704, 709, 714,
- 721, 726, 731, 736, 741, 748, 755, 758, 766, 768,
- 771, 772, 774, 775, 779, 786, 790, 797, 800, 805,
- 812
+ 60, 62, 64, 66, 68, 70, 72, 74, 76, 78,
+ 80, 82, 84, 86, 88, 90, 92, 94, 96, 98,
+ 100, 102, 104, 106, 108, 110, 112, 114, 116, 118,
+ 120, 122, 124, 126, 127, 130, 131, 133, 135, 137,
+ 138, 141, 143, 145, 147, 149, 151, 153, 155, 157,
+ 158, 160, 162, 164, 165, 167, 169, 170, 172, 174,
+ 176, 178, 179, 181, 183, 184, 186, 188, 190, 192,
+ 194, 197, 199, 201, 203, 205, 207, 209, 211, 213,
+ 215, 216, 219, 221, 223, 225, 227, 228, 231, 232,
+ 235, 236, 240, 243, 244, 246, 247, 251, 253, 256,
+ 258, 260, 262, 264, 266, 268, 270, 272, 274, 277,
+ 279, 282, 288, 294, 300, 306, 310, 313, 319, 324,
+ 327, 329, 331, 333, 337, 339, 343, 345, 346, 348,
+ 352, 357, 361, 365, 370, 375, 379, 386, 392, 395,
+ 398, 401, 404, 407, 410, 413, 416, 419, 422, 425,
+ 428, 435, 441, 450, 457, 464, 472, 480, 487, 496,
+ 505, 509, 511, 513, 515, 517, 518, 521, 528, 530,
+ 531, 533, 536, 537, 541, 542, 546, 550, 554, 558,
+ 559, 567, 568, 577, 578, 587, 593, 596, 600, 602,
+ 606, 610, 614, 618, 620, 621, 627, 631, 633, 637,
+ 639, 640, 650, 652, 654, 659, 661, 663, 666, 670,
+ 671, 673, 675, 677, 679, 681, 683, 685, 687, 689,
+ 693, 695, 701, 703, 705, 707, 709, 711, 713, 716,
+ 719, 722, 726, 729, 730, 732, 735, 738, 742, 752,
+ 762, 771, 786, 788, 790, 797, 803, 806, 813, 821,
+ 825, 829, 835, 841, 842, 843, 847, 850, 852, 858,
+ 864, 871, 878, 883, 890, 895, 900, 907, 914, 917,
+ 926, 928, 930, 931, 935, 942, 946, 953, 956, 962,
+ 970
};
-static const short yyrhs[] = { 5,
- 0, 6, 0, 3, 0, 4, 0, 78, 0, 79,
- 0, 80, 0, 81, 0, 82, 0, 83, 0, 84,
- 0, 85, 0, 86, 0, 87, 0, 88, 0, 89,
- 0, 90, 0, 91, 0, 101, 0, 102, 0, 16,
- 0, 14, 0, 12, 0, 10, 0, 17, 0, 15,
- 0, 13, 0, 11, 0, 129, 0, 130, 0, 18,
- 0, 19, 0, 165, 109, 0, 0, 41, 0, 42,
- 0, 43, 0, 44, 0, 45, 0, 46, 0, 47,
- 0, 0, 0, 65, 0, 66, 0, 67, 0, 68,
- 0, 69, 0, 70, 0, 64, 4, 0, 0, 57,
- 4, 0, 0, 110, 57, 4, 0, 34, 24, 0,
- 0, 138, 0, 0, 110, 141, 140, 0, 138, 0,
- 57, 4, 0, 144, 0, 8, 0, 146, 0, 8,
- 0, 146, 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, 48,
- 0, 145, 0, 180, 0, 111, 4, 0, 143, 112,
- 148, 113, 0, 114, 4, 115, 146, 116, 0, 117,
- 4, 115, 146, 118, 0, 119, 147, 120, 0, 119,
- 120, 0, 146, 121, 0, 146, 0, 147, 110, 146,
- 0, 147, 0, 147, 110, 37, 0, 37, 0, 0,
- 144, 114, 151, 116, 0, 144, 114, 116, 0, 144,
- 122, 24, 0, 144, 117, 151, 118, 0, 144, 119,
- 151, 120, 0, 144, 119, 120, 0, 144, 38, 0,
- 144, 39, 0, 144, 180, 0, 144, 150, 0, 144,
- 26, 0, 129, 124, 0, 130, 4, 0, 9, 27,
- 0, 9, 28, 0, 132, 7, 0, 99, 112, 149,
- 36, 144, 113, 0, 97, 112, 149, 194, 113, 0,
- 100, 112, 149, 110, 149, 110, 149, 113, 0, 125,
- 112, 149, 110, 149, 113, 0, 126, 112, 149, 110,
- 149, 113, 0, 127, 112, 149, 110, 149, 113, 0,
- 128, 112, 149, 110, 149, 113, 0, 104, 112, 149,
- 110, 149, 113, 0, 105, 112, 149, 110, 149, 110,
- 149, 113, 0, 106, 112, 149, 110, 149, 110, 149,
- 113, 0, 151, 110, 149, 0, 149, 0, 32, 0,
- 33, 0, 154, 0, 154, 174, 0, 154, 176, 0,
- 154, 62, 61, 160, 0, 154, 25, 0, 155, 0,
- 155, 133, 20, 142, 0, 155, 176, 0, 155, 62,
- 61, 160, 0, 0, 155, 133, 134, 152, 149, 156,
- 140, 0, 0, 155, 133, 50, 152, 144, 157, 140,
- 0, 0, 155, 133, 45, 152, 144, 158, 140, 0,
- 0, 155, 133, 47, 152, 144, 159, 140, 0, 155,
- 51, 162, 0, 155, 58, 109, 163, 0, 0, 24,
- 0, 56, 0, 55, 0, 53, 109, 161, 0, 54,
- 109, 4, 0, 52, 109, 24, 0, 71, 109, 24,
- 0, 114, 164, 116, 0, 164, 110, 24, 0, 24,
- 0, 0, 22, 0, 24, 0, 165, 0, 0, 144,
- 166, 0, 168, 110, 167, 0, 167, 0, 168, 0,
- 168, 110, 37, 0, 37, 0, 0, 135, 142, 165,
- 112, 169, 113, 139, 136, 0, 29, 0, 119, 0,
- 134, 170, 171, 0, 30, 0, 120, 0, 183, 173,
- 0, 0, 45, 0, 47, 0, 0, 31, 177, 175,
- 170, 0, 0, 63, 0, 3, 0, 4, 0, 7,
- 0, 27, 0, 28, 0, 38, 0, 39, 0, 26,
- 0, 117, 151, 118, 0, 150, 0, 61, 178, 24,
- 110, 24, 0, 123, 0, 165, 0, 180, 0, 179,
- 0, 144, 181, 0, 183, 184, 0, 172, 184, 0,
- 185, 133, 186, 0, 185, 188, 0, 0, 23, 0,
- 72, 182, 0, 72, 8, 0, 73, 21, 181, 0,
- 73, 9, 181, 110, 21, 181, 110, 21, 181, 0,
- 74, 131, 181, 110, 21, 181, 114, 187, 116, 0,
- 74, 131, 181, 110, 21, 181, 114, 116, 0, 75,
- 135, 142, 181, 112, 191, 113, 36, 21, 181, 76,
- 21, 181, 0, 76, 0, 77, 0, 187, 131, 179,
- 110, 21, 181, 0, 131, 179, 110, 21, 181, 0,
- 133, 193, 0, 144, 114, 181, 110, 181, 116, 0,
- 189, 110, 114, 181, 110, 181, 116, 0, 182, 0,
- 190, 110, 182, 0, 190, 0, 0, 60, 59, 0,
- 59, 0, 125, 144, 181, 110, 181, 0, 126, 144,
- 181, 110, 181, 0, 127, 144, 181, 110, 181, 0,
- 49, 182, 0, 128, 182, 110, 182, 0, 99, 182,
- 36, 144, 0, 100, 182, 110, 182, 110, 182, 0,
- 103, 182, 110, 144, 0, 107, 182, 110, 144, 0,
- 108, 182, 110, 144, 0, 104, 182, 110, 182, 0,
- 105, 182, 110, 182, 110, 182, 0, 106, 182, 110,
- 182, 110, 182, 0, 98, 189, 0, 192, 135, 142,
- 181, 112, 191, 113, 0, 196, 0, 110, 190, 0,
- 0, 35, 0, 0, 92, 144, 137, 0, 92, 144,
- 110, 15, 181, 137, 0, 93, 144, 137, 0, 93,
- 144, 110, 15, 181, 137, 0, 94, 182, 0, 195,
- 95, 144, 181, 0, 195, 96, 182, 110, 144, 181,
- 0, 97, 144, 181, 194, 0
+static const short yyrhs[] = { 73,
+ 0, 74, 0, 75, 0, 76, 0, 77, 0, 78,
+ 0, 79, 0, 80, 0, 81, 0, 85, 0, 86,
+ 0, 87, 0, 82, 0, 83, 0, 84, 0, 116,
+ 0, 117, 0, 118, 0, 119, 0, 120, 0, 121,
+ 0, 122, 0, 123, 0, 124, 0, 125, 0, 126,
+ 0, 127, 0, 90, 0, 91, 0, 92, 0, 93,
+ 0, 94, 0, 95, 0, 96, 0, 97, 0, 98,
+ 0, 99, 0, 100, 0, 101, 0, 102, 0, 103,
+ 0, 104, 0, 105, 0, 106, 0, 107, 0, 108,
+ 0, 109, 0, 96, 0, 97, 0, 98, 0, 99,
+ 0, 26, 0, 27, 0, 11, 0, 12, 0, 13,
+ 0, 16, 0, 15, 0, 14, 0, 19, 0, 22,
+ 0, 24, 0, 167, 0, 0, 167, 146, 0, 0,
+ 20, 0, 23, 0, 172, 0, 0, 170, 146, 0,
+ 42, 0, 44, 0, 43, 0, 45, 0, 47, 0,
+ 46, 0, 48, 0, 50, 0, 0, 143, 0, 144,
+ 0, 145, 0, 0, 46, 0, 48, 0, 0, 42,
+ 0, 43, 0, 44, 0, 47, 0, 0, 44, 0,
+ 42, 0, 0, 61, 0, 62, 0, 63, 0, 64,
+ 0, 65, 0, 60, 4, 0, 135, 0, 117, 0,
+ 134, 0, 118, 0, 137, 0, 138, 0, 140, 0,
+ 141, 0, 142, 0, 0, 181, 180, 0, 136, 0,
+ 139, 0, 135, 0, 134, 0, 0, 183, 182, 0,
+ 0, 53, 4, 0, 0, 147, 53, 4, 0, 34,
+ 22, 0, 0, 186, 0, 0, 147, 189, 188, 0,
+ 186, 0, 53, 4, 0, 11, 0, 12, 0, 13,
+ 0, 16, 0, 15, 0, 14, 0, 17, 0, 49,
+ 0, 190, 0, 191, 148, 0, 225, 0, 149, 4,
+ 0, 191, 150, 195, 151, 183, 0, 10, 150, 195,
+ 151, 183, 0, 152, 4, 153, 191, 154, 0, 155,
+ 4, 153, 191, 156, 0, 157, 196, 158, 0, 157,
+ 158, 0, 155, 157, 196, 158, 156, 0, 155, 157,
+ 158, 156, 0, 191, 181, 0, 191, 0, 10, 0,
+ 192, 0, 194, 147, 192, 0, 194, 0, 194, 147,
+ 39, 0, 39, 0, 0, 191, 0, 196, 147, 191,
+ 0, 191, 152, 199, 154, 0, 191, 152, 154, 0,
+ 191, 159, 22, 0, 191, 155, 199, 156, 0, 191,
+ 157, 199, 158, 0, 191, 157, 158, 0, 191, 155,
+ 157, 199, 158, 156, 0, 191, 155, 157, 158, 156,
+ 0, 191, 40, 0, 191, 41, 0, 191, 225, 0,
+ 191, 198, 0, 191, 25, 0, 165, 3, 0, 165,
+ 5, 0, 165, 4, 0, 165, 6, 0, 11, 26,
+ 0, 11, 27, 0, 166, 9, 0, 162, 150, 197,
+ 38, 191, 151, 0, 115, 150, 197, 236, 151, 0,
+ 129, 150, 197, 147, 197, 147, 197, 151, 0, 160,
+ 150, 197, 147, 197, 151, 0, 161, 150, 197, 147,
+ 197, 151, 0, 88, 163, 150, 197, 147, 197, 151,
+ 0, 89, 164, 150, 197, 147, 197, 151, 0, 131,
+ 150, 197, 147, 197, 151, 0, 132, 150, 197, 147,
+ 197, 147, 197, 151, 0, 133, 150, 197, 147, 197,
+ 147, 197, 151, 0, 199, 147, 197, 0, 197, 0,
+ 32, 0, 33, 0, 37, 0, 0, 193, 225, 0,
+ 121, 150, 202, 38, 191, 151, 0, 204, 0, 0,
+ 205, 0, 204, 205, 0, 0, 31, 206, 221, 0,
+ 0, 30, 207, 222, 0, 58, 57, 211, 0, 169,
+ 18, 191, 0, 169, 18, 10, 0, 0, 171, 175,
+ 201, 200, 197, 208, 188, 0, 0, 171, 173, 175,
+ 201, 200, 197, 209, 188, 0, 0, 171, 174, 175,
+ 201, 200, 191, 210, 188, 0, 171, 175, 35, 178,
+ 202, 0, 51, 212, 0, 54, 146, 213, 0, 22,
+ 0, 52, 146, 22, 0, 66, 146, 22, 0, 152,
+ 214, 154, 0, 214, 147, 22, 0, 22, 0, 0,
+ 215, 147, 191, 181, 168, 0, 191, 181, 168, 0,
+ 215, 0, 215, 147, 39, 0, 39, 0, 0, 179,
+ 193, 170, 150, 216, 151, 183, 187, 184, 0, 28,
+ 0, 157, 0, 177, 175, 217, 218, 0, 29, 0,
+ 158, 0, 228, 220, 0, 176, 175, 217, 0, 0,
+ 59, 0, 3, 0, 4, 0, 9, 0, 26, 0,
+ 27, 0, 40, 0, 41, 0, 25, 0, 155, 199,
+ 156, 0, 198, 0, 57, 223, 22, 147, 22, 0,
+ 7, 0, 8, 0, 167, 0, 170, 0, 225, 0,
+ 224, 0, 191, 226, 0, 228, 229, 0, 219, 229,
+ 0, 230, 169, 231, 0, 230, 233, 0, 0, 21,
+ 0, 67, 227, 0, 67, 10, 0, 68, 17, 226,
+ 0, 68, 11, 226, 147, 17, 226, 147, 17, 226,
+ 0, 69, 165, 226, 147, 17, 226, 152, 232, 154,
+ 0, 69, 165, 226, 147, 17, 226, 152, 154, 0,
+ 70, 179, 193, 226, 150, 235, 151, 183, 38, 17,
+ 226, 71, 17, 226, 0, 71, 0, 72, 0, 232,
+ 165, 224, 147, 17, 226, 0, 165, 224, 147, 17,
+ 226, 0, 169, 238, 0, 191, 152, 226, 147, 226,
+ 154, 0, 234, 147, 152, 226, 147, 226, 154, 0,
+ 191, 226, 181, 0, 17, 226, 181, 0, 235, 147,
+ 191, 226, 181, 0, 235, 147, 17, 226, 181, 0,
+ 0, 0, 236, 147, 227, 0, 56, 55, 0, 55,
+ 0, 160, 191, 226, 147, 226, 0, 161, 191, 226,
+ 147, 226, 0, 88, 163, 191, 226, 147, 226, 0,
+ 89, 164, 191, 226, 147, 226, 0, 162, 227, 38,
+ 191, 0, 129, 227, 147, 227, 147, 227, 0, 130,
+ 227, 147, 191, 0, 131, 227, 147, 227, 0, 132,
+ 227, 147, 227, 147, 227, 0, 133, 227, 147, 227,
+ 147, 227, 0, 128, 234, 0, 237, 179, 193, 226,
+ 150, 235, 151, 183, 0, 240, 0, 36, 0, 0,
+ 110, 191, 185, 0, 110, 191, 147, 11, 226, 185,
+ 0, 111, 191, 185, 0, 111, 191, 147, 11, 226,
+ 185, 0, 112, 227, 0, 239, 113, 191, 226, 185,
+ 0, 239, 114, 227, 147, 191, 226, 185, 0, 115,
+ 191, 226, 236, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 1097, 1098, 1106, 1107, 1117, 1117, 1117, 1117, 1117, 1118,
- 1118, 1118, 1119, 1119, 1119, 1119, 1119, 1119, 1121, 1121,
- 1125, 1125, 1125, 1125, 1126, 1126, 1126, 1126, 1127, 1127,
- 1128, 1128, 1131, 1135, 1140, 1140, 1141, 1142, 1143, 1144,
- 1145, 1146, 1149, 1149, 1150, 1151, 1152, 1153, 1154, 1155,
- 1165, 1165, 1172, 1172, 1181, 1189, 1189, 1195, 1195, 1197,
- 1202, 1216, 1216, 1217, 1217, 1219, 1229, 1229, 1229, 1229,
- 1229, 1229, 1229, 1230, 1230, 1230, 1230, 1230, 1230, 1231,
- 1235, 1239, 1247, 1255, 1268, 1273, 1285, 1295, 1299, 1310,
- 1315, 1321, 1322, 1326, 1330, 1341, 1367, 1381, 1411, 1437,
- 1458, 1471, 1481, 1486, 1547, 1554, 1563, 1569, 1575, 1579,
- 1583, 1591, 1602, 1634, 1642, 1664, 1675, 1681, 1689, 1695,
- 1701, 1710, 1714, 1722, 1722, 1732, 1740, 1745, 1749, 1753,
- 1757, 1772, 1794, 1797, 1800, 1805, 1808, 1812, 1816, 1820,
- 1824, 1829, 1833, 1836, 1839, 1843, 1856, 1857, 1859, 1863,
- 1872, 1877, 1883, 1885, 1890, 1895, 1904, 1904, 1905, 1905,
- 1907, 1914, 1920, 1927, 1931, 1937, 1942, 1947, 2042, 2042,
- 2044, 2052, 2052, 2054, 2059, 2059, 2060, 2063, 2063, 2073,
- 2077, 2082, 2086, 2090, 2094, 2098, 2102, 2106, 2110, 2114,
- 2139, 2143, 2157, 2161, 2167, 2167, 2173, 2178, 2182, 2191,
- 2202, 2207, 2219, 2232, 2236, 2240, 2245, 2254, 2273, 2282,
- 2338, 2342, 2349, 2360, 2373, 2382, 2391, 2401, 2405, 2412,
- 2412, 2414, 2418, 2423, 2439, 2454, 2468, 2481, 2489, 2497,
- 2505, 2511, 2531, 2554, 2560, 2566, 2572, 2587, 2646, 2653,
- 2656, 2661, 2665, 2672, 2677, 2683, 2688, 2694, 2702, 2714,
- 2729
+ 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1128,
+ 1128, 1128, 1128, 1128, 1128, 1129, 1129, 1129, 1129, 1129,
+ 1129, 1129, 1130, 1130, 1130, 1130, 1130, 1133, 1133, 1134,
+ 1134, 1135, 1135, 1136, 1136, 1137, 1137, 1141, 1141, 1142,
+ 1142, 1143, 1143, 1144, 1144, 1145, 1145, 1146, 1146, 1147,
+ 1147, 1148, 1149, 1154, 1155, 1155, 1155, 1155, 1155, 1157,
+ 1157, 1157, 1158, 1158, 1162, 1166, 1171, 1171, 1173, 1174,
+ 1179, 1185, 1186, 1187, 1188, 1189, 1193, 1194, 1195, 1199,
+ 1200, 1201, 1202, 1206, 1207, 1208, 1212, 1213, 1214, 1215,
+ 1216, 1220, 1221, 1222, 1225, 1225, 1226, 1227, 1228, 1229,
+ 1230, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246,
+ 1249, 1250, 1255, 1256, 1257, 1258, 1261, 1262, 1269, 1269,
+ 1276, 1276, 1285, 1293, 1293, 1299, 1299, 1301, 1306, 1319,
+ 1319, 1319, 1319, 1319, 1319, 1319, 1322, 1326, 1330, 1337,
+ 1342, 1350, 1380, 1411, 1416, 1428, 1438, 1442, 1452, 1459,
+ 1466, 1473, 1478, 1483, 1490, 1491, 1498, 1505, 1513, 1519,
+ 1531, 1559, 1575, 1602, 1630, 1656, 1676, 1702, 1722, 1734,
+ 1741, 1807, 1817, 1827, 1833, 1843, 1849, 1859, 1864, 1869,
+ 1882, 1894, 1916, 1924, 1930, 1941, 1946, 1951, 1957, 1963,
+ 1972, 1976, 1984, 1984, 1987, 1987, 1990, 2002, 2023, 2028,
+ 2036, 2037, 2041, 2041, 2045, 2045, 2048, 2051, 2075, 2086,
+ 2093, 2096, 2102, 2105, 2112, 2116, 2156, 2159, 2165, 2175,
+ 2179, 2184, 2186, 2191, 2196, 2205, 2215, 2226, 2230, 2239,
+ 2248, 2253, 2374, 2374, 2376, 2385, 2385, 2387, 2392, 2404,
+ 2408, 2413, 2417, 2421, 2425, 2429, 2433, 2437, 2441, 2445,
+ 2470, 2474, 2484, 2488, 2492, 2497, 2504, 2504, 2510, 2519,
+ 2523, 2532, 2541, 2550, 2554, 2561, 2565, 2569, 2574, 2584,
+ 2603, 2612, 2692, 2696, 2703, 2714, 2727, 2737, 2748, 2758,
+ 2767, 2773, 2782, 2788, 2791, 2792, 2799, 2803, 2808, 2829,
+ 2846, 2860, 2874, 2886, 2894, 2901, 2907, 2913, 2919, 2934,
+ 3019, 3024, 3028, 3035, 3042, 3050, 3057, 3065, 3073, 3087,
+ 3104
};
#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","TYPE","LABEL","VAR_ID",
-"LABELSTR","STRINGCONSTANT","IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK",
-"BEGINTOK","ENDTOK","DECLARE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO",
-"DOTDOTDOT","NULL_TOK","UNDEF","CONST","INTERNAL","LINKONCE","WEAK","APPENDING",
-"DLLIMPORT","DLLEXPORT","EXTERN_WEAK","OPAQUE","NOT","EXTERNAL","TARGET","TRIPLE",
-"ENDIAN","POINTERSIZE","LITTLE","BIG","ALIGN","DEPLIBS","CALL","TAIL","ASM_TOK",
-"MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","CSRETCC_TOK","FASTCC_TOK","COLDCC_TOK",
-"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATA","RET","BR","SWITCH","INVOKE",
-"UNWIND","UNREACHABLE","ADD","SUB","MUL","DIV","REM","AND","OR","XOR","SETLE",
-"SETGE","SETLT","SETGT","SETEQ","SETNE","MALLOC","ALLOCA","FREE","LOAD","STORE",
-"GETELEMENTPTR","PHI_TOK","CAST","SELECT","SHL","SHR","VAARG","EXTRACTELEMENT",
-"INSERTELEMENT","SHUFFLEVECTOR","VAARG_old","VANEXT_old","'='","','","'\\\\'",
-"'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'*'","'c'","INTVAL","EINT64VAL",
-"ArithmeticOps","LogicalOps","SetCondOps","ShiftOps","SIntType","UIntType","IntType",
-"FPType","OptAssign","OptLinkage","OptCallingConv","OptAlign","OptCAlign","SectionString",
-"OptSection","GlobalVarAttributes","GlobalVarAttribute","TypesV","UpRTypesV",
-"Types","PrimType","UpRTypes","TypeListI","ArgTypeListI","ConstVal","ConstExpr",
-"ConstVector","GlobalType","Module","FunctionList","ConstPool","@1","@2","@3",
-"@4","AsmBlock","BigOrLittle","TargetDefinition","LibrariesDefinition","LibList",
-"Name","OptName","ArgVal","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader",
-"END","Function","FnDeclareLinkage","FunctionProto","@5","OptSideEffect","ConstValueRef",
+"EUINT64VAL","ESAPINTVAL","EUAPINTVAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL",
+"VOID","INTTYPE","FLOAT","DOUBLE","X86_FP80","FP128","PPC_FP128","LABEL","TYPE",
+"LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT","PCTSTRINGCONSTANT",
+"ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK","DECLARE","DEFINE",
+"GLOBAL","CONSTANT","SECTION","ALIAS","VOLATILE","THREAD_LOCAL","TO","DOTDOTDOT",
+"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT",
+"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","DEPLIBS","CALL",
+"TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","FASTCC_TOK","COLDCC_TOK",
+"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE",
+"UNWIND","UNREACHABLE","ADD","SUB","MUL","UDIV","SDIV","FDIV","UREM","SREM",
+"FREM","AND","OR","XOR","SHL","LSHR","ASHR","ICMP","FCMP","EQ","NE","SLT","SGT",
+"SLE","SGE","ULT","UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD",
+"UNO","UEQ","UNE","MALLOC","ALLOCA","FREE","LOAD","STORE","GETELEMENTPTR","TRUNC",
+"ZEXT","SEXT","FPTRUNC","FPEXT","BITCAST","UITOFP","SITOFP","FPTOUI","FPTOSI",
+"INTTOPTR","PTRTOINT","PHI_TOK","SELECT","VAARG","EXTRACTELEMENT","INSERTELEMENT",
+"SHUFFLEVECTOR","SIGNEXT","ZEROEXT","NORETURN","INREG","SRET","NOUNWIND","NOALIAS",
+"BYVAL","NEST","DEFAULT","HIDDEN","PROTECTED","'='","','","'*'","'\\\\'","'('",
+"')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps","LogicalOps",
+"CastOps","IPredicates","FPredicates","IntType","FPType","LocalName","OptLocalName",
+"OptLocalAssign","GlobalName","OptGlobalAssign","GlobalAssign","GVInternalLinkage",
+"GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage",
+"AliasLinkage","OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs",
+"OptAlign","OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute",
+"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI",
+"ConstVal","ConstExpr","ConstVector","GlobalType","ThreadLocal","AliaseeRef",
+"Module","DefinitionList","Definition","@1","@2","@3","@4","@5","AsmBlock","TargetDefinition",
+"LibrariesDefinition","LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN",
+"FunctionHeader","END","Function","FunctionProto","OptSideEffect","ConstValueRef",
"SymbolicValueRef","ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList",
-"BBTerminatorInst","JumpTable","Inst","PHIList","ValueRefList","ValueRefListE",
-"OptTailCall","InstVal","IndexList","OptVolatile","MemoryInst", NULL
+"BBTerminatorInst","JumpTable","Inst","PHIList","ParamList","IndexList","OptTailCall",
+"InstVal","OptVolatile","MemoryInst", NULL
};
#endif
static const short yyr1[] = { 0,
- 123, 123, 124, 124, 125, 125, 125, 125, 125, 126,
- 126, 126, 127, 127, 127, 127, 127, 127, 128, 128,
- 129, 129, 129, 129, 130, 130, 130, 130, 131, 131,
- 132, 132, 133, 133, 134, 134, 134, 134, 134, 134,
- 134, 134, 135, 135, 135, 135, 135, 135, 135, 135,
- 136, 136, 137, 137, 138, 139, 139, 140, 140, 141,
- 141, 142, 142, 143, 143, 144, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 146,
- 146, 146, 146, 146, 146, 146, 146, 146, 146, 147,
- 147, 148, 148, 148, 148, 149, 149, 149, 149, 149,
- 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
- 149, 150, 150, 150, 150, 150, 150, 150, 150, 150,
- 150, 151, 151, 152, 152, 153, 154, 154, 154, 154,
- 154, 155, 155, 155, 156, 155, 157, 155, 158, 155,
- 159, 155, 155, 155, 155, 160, 161, 161, 162, 162,
- 162, 162, 163, 164, 164, 164, 165, 165, 166, 166,
- 167, 168, 168, 169, 169, 169, 169, 170, 171, 171,
- 172, 173, 173, 174, 175, 175, 175, 177, 176, 178,
- 178, 179, 179, 179, 179, 179, 179, 179, 179, 179,
- 179, 179, 180, 180, 181, 181, 182, 183, 183, 184,
- 185, 185, 185, 186, 186, 186, 186, 186, 186, 186,
- 186, 186, 187, 187, 188, 189, 189, 190, 190, 191,
- 191, 192, 192, 193, 193, 193, 193, 193, 193, 193,
- 193, 193, 193, 193, 193, 193, 193, 193, 193, 194,
- 194, 195, 195, 196, 196, 196, 196, 196, 196, 196,
- 196
+ 160, 160, 160, 160, 160, 160, 160, 160, 160, 161,
+ 161, 161, 161, 161, 161, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 163, 163, 163,
+ 163, 163, 163, 163, 163, 163, 163, 164, 164, 164,
+ 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
+ 164, 164, 164, 165, 166, 166, 166, 166, 166, 167,
+ 167, 167, 168, 168, 169, 169, 170, 170, 171, 171,
+ 172, 173, 173, 173, 173, 173, 174, 174, 174, 175,
+ 175, 175, 175, 176, 176, 176, 177, 177, 177, 177,
+ 177, 178, 178, 178, 179, 179, 179, 179, 179, 179,
+ 179, 180, 180, 180, 180, 180, 180, 180, 180, 180,
+ 181, 181, 182, 182, 182, 182, 183, 183, 184, 184,
+ 185, 185, 186, 187, 187, 188, 188, 189, 189, 190,
+ 190, 190, 190, 190, 190, 190, 191, 191, 191, 191,
+ 191, 191, 191, 191, 191, 191, 191, 191, 191, 192,
+ 193, 193, 194, 194, 195, 195, 195, 195, 196, 196,
+ 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
+ 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
+ 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
+ 199, 199, 200, 200, 201, 201, 202, 202, 203, 203,
+ 204, 204, 206, 205, 207, 205, 205, 205, 205, 208,
+ 205, 209, 205, 210, 205, 205, 205, 205, 211, 212,
+ 212, 213, 214, 214, 214, 215, 215, 216, 216, 216,
+ 216, 217, 218, 218, 219, 220, 220, 221, 222, 223,
+ 223, 224, 224, 224, 224, 224, 224, 224, 224, 224,
+ 224, 224, 225, 225, 225, 225, 226, 226, 227, 228,
+ 228, 229, 230, 230, 230, 231, 231, 231, 231, 231,
+ 231, 231, 231, 231, 232, 232, 233, 234, 234, 235,
+ 235, 235, 235, 235, 236, 236, 237, 237, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 239, 239, 240, 240, 240, 240, 240, 240, 240,
+ 240
};
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, 2, 0, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 1, 1, 1, 1, 1, 1, 2,
- 0, 2, 0, 3, 2, 0, 1, 0, 3, 1,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 4, 5, 5, 3, 2, 2, 1,
- 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
- 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 6, 5, 8, 6, 6, 6, 6, 6, 8,
- 8, 3, 1, 1, 1, 1, 2, 2, 4, 2,
- 1, 4, 2, 4, 0, 7, 0, 7, 0, 7,
- 0, 7, 3, 4, 0, 1, 1, 1, 3, 3,
- 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
- 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
- 3, 1, 1, 2, 0, 1, 1, 0, 4, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 2, 0, 1, 1, 1, 0,
+ 2, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,
+ 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
+ 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 2, 1, 1, 1, 1, 0, 2, 0, 2,
+ 0, 3, 2, 0, 1, 0, 3, 1, 2, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
+ 2, 5, 5, 5, 5, 3, 2, 5, 4, 2,
+ 1, 1, 1, 3, 1, 3, 1, 0, 1, 3,
+ 4, 3, 3, 4, 4, 3, 6, 5, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 6, 5, 8, 6, 6, 7, 7, 6, 8, 8,
+ 3, 1, 1, 1, 1, 0, 2, 6, 1, 0,
+ 1, 2, 0, 3, 0, 3, 3, 3, 3, 0,
+ 7, 0, 8, 0, 8, 5, 2, 3, 1, 3,
+ 3, 3, 3, 1, 0, 5, 3, 1, 3, 1,
+ 0, 9, 1, 1, 4, 1, 1, 2, 3, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
- 1, 5, 1, 1, 1, 1, 2, 2, 2, 3,
- 2, 0, 1, 2, 2, 3, 9, 9, 8, 13,
- 1, 1, 6, 5, 2, 6, 7, 1, 3, 1,
- 0, 2, 1, 5, 5, 5, 2, 4, 4, 6,
- 4, 4, 4, 4, 6, 6, 2, 7, 1, 2,
- 0, 1, 0, 3, 6, 3, 6, 2, 4, 6,
+ 1, 5, 1, 1, 1, 1, 1, 1, 2, 2,
+ 2, 3, 2, 0, 1, 2, 2, 3, 9, 9,
+ 8, 14, 1, 1, 6, 5, 2, 6, 7, 3,
+ 3, 5, 5, 0, 0, 3, 2, 1, 5, 5,
+ 6, 6, 4, 6, 4, 4, 6, 6, 2, 8,
+ 1, 1, 0, 3, 6, 3, 6, 2, 5, 7,
4
};
-static const short yydefact[] = { 145,
- 42, 131, 130, 178, 35, 36, 37, 38, 39, 40,
- 41, 0, 43, 202, 127, 128, 202, 157, 158, 0,
- 0, 0, 42, 0, 133, 175, 0, 0, 44, 45,
- 46, 47, 48, 49, 0, 0, 203, 199, 34, 172,
- 173, 174, 198, 0, 0, 0, 0, 143, 0, 0,
- 0, 0, 0, 0, 0, 33, 176, 177, 43, 146,
- 129, 50, 1, 2, 63, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 0,
- 0, 0, 0, 193, 0, 0, 62, 81, 66, 194,
- 82, 169, 170, 171, 243, 201, 0, 0, 0, 0,
- 156, 144, 134, 132, 124, 125, 0, 0, 0, 0,
- 179, 83, 0, 0, 65, 88, 90, 0, 0, 95,
- 89, 242, 0, 223, 0, 0, 0, 0, 43, 211,
- 212, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 0, 0, 0, 0, 0,
- 0, 0, 19, 20, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 200, 43, 215, 0, 239, 151,
- 148, 147, 149, 150, 152, 155, 0, 139, 141, 137,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 0, 0, 0, 0, 135, 0, 0, 0, 87,
- 167, 94, 92, 0, 0, 227, 222, 205, 204, 0,
- 0, 24, 28, 23, 27, 22, 26, 21, 25, 29,
- 30, 0, 0, 53, 53, 248, 0, 0, 237, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 153, 58, 58, 58, 109,
- 110, 3, 4, 107, 108, 111, 106, 102, 103, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 105, 104, 58, 64, 64, 91, 166,
- 160, 163, 164, 0, 0, 84, 182, 183, 184, 189,
- 185, 186, 187, 188, 180, 0, 191, 196, 195, 197,
- 0, 206, 0, 0, 0, 244, 0, 246, 241, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 154, 0, 140, 142,
- 138, 0, 0, 0, 0, 0, 0, 97, 123, 0,
- 0, 101, 0, 98, 0, 0, 0, 0, 136, 85,
- 86, 159, 161, 0, 56, 93, 181, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 251, 0, 0, 229,
- 0, 231, 234, 0, 0, 232, 233, 0, 0, 0,
- 228, 0, 249, 0, 0, 0, 60, 58, 241, 0,
- 0, 0, 0, 0, 0, 96, 99, 100, 0, 0,
- 0, 0, 165, 162, 57, 51, 0, 190, 0, 0,
- 221, 53, 54, 53, 218, 240, 0, 0, 0, 0,
- 0, 224, 225, 226, 221, 0, 55, 61, 59, 0,
- 0, 0, 0, 0, 0, 122, 0, 0, 0, 0,
- 0, 168, 0, 0, 0, 220, 0, 0, 245, 247,
- 0, 0, 0, 230, 235, 236, 0, 250, 113, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 52, 192,
- 0, 0, 0, 219, 216, 0, 238, 112, 0, 119,
- 0, 0, 115, 116, 117, 118, 0, 209, 0, 0,
- 0, 217, 0, 0, 0, 207, 0, 208, 0, 0,
- 114, 120, 121, 0, 0, 0, 0, 0, 0, 214,
- 0, 0, 213, 210, 0, 0, 0
+static const short yydefact[] = { 70,
+ 60, 67, 61, 68, 62, 205, 203, 0, 0, 0,
+ 0, 0, 0, 80, 69, 70, 201, 84, 87, 0,
+ 0, 217, 0, 0, 65, 0, 71, 72, 74, 73,
+ 75, 77, 76, 78, 79, 81, 82, 83, 80, 80,
+ 196, 202, 85, 86, 80, 206, 88, 89, 90, 91,
+ 80, 264, 204, 264, 0, 0, 225, 218, 219, 207,
+ 253, 254, 209, 130, 131, 132, 135, 134, 133, 136,
+ 137, 0, 0, 0, 0, 255, 256, 138, 208, 140,
+ 196, 196, 92, 195, 0, 95, 95, 265, 261, 66,
+ 236, 237, 238, 260, 220, 221, 224, 0, 158, 141,
+ 0, 0, 0, 0, 147, 159, 0, 139, 158, 0,
+ 0, 94, 93, 0, 193, 194, 0, 0, 96, 97,
+ 98, 99, 100, 0, 239, 0, 303, 263, 0, 222,
+ 157, 111, 153, 155, 0, 0, 0, 0, 0, 0,
+ 146, 0, 0, 0, 152, 0, 151, 0, 216, 130,
+ 131, 132, 135, 134, 133, 0, 0, 0, 210, 101,
+ 0, 233, 234, 235, 302, 288, 0, 0, 0, 0,
+ 95, 273, 274, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 13, 14, 15, 10, 11, 12, 0, 0,
+ 0, 0, 0, 0, 16, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 262, 95, 277, 0, 301,
+ 223, 150, 0, 117, 0, 0, 149, 0, 160, 117,
+ 212, 214, 0, 197, 178, 179, 174, 176, 175, 177,
+ 180, 173, 169, 170, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 172, 171,
+ 126, 0, 287, 267, 0, 266, 0, 0, 54, 0,
+ 0, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 0, 52, 53, 48, 49, 50, 51, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 0, 121,
+ 121, 308, 0, 0, 299, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 103, 105, 104, 102,
+ 106, 107, 108, 109, 110, 112, 156, 154, 143, 144,
+ 145, 148, 142, 126, 126, 0, 0, 0, 0, 0,
+ 0, 0, 0, 162, 192, 0, 0, 0, 166, 0,
+ 163, 0, 0, 0, 0, 211, 231, 242, 243, 244,
+ 249, 245, 246, 247, 248, 240, 0, 251, 258, 257,
+ 259, 0, 268, 0, 0, 0, 0, 0, 304, 0,
+ 306, 285, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 116, 115, 113, 114, 118,
+ 213, 215, 0, 0, 0, 285, 0, 0, 0, 0,
+ 0, 161, 147, 159, 0, 164, 165, 0, 0, 0,
+ 0, 0, 128, 126, 230, 111, 228, 0, 241, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 311,
+ 0, 0, 0, 295, 296, 0, 0, 0, 0, 293,
+ 0, 121, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 191, 168, 0, 0, 0, 0, 123, 129, 127,
+ 64, 0, 117, 0, 250, 0, 0, 284, 0, 0,
+ 121, 122, 121, 0, 0, 0, 0, 0, 0, 289,
+ 290, 284, 0, 309, 0, 198, 0, 0, 182, 0,
+ 0, 0, 0, 167, 0, 0, 0, 63, 227, 229,
+ 111, 124, 0, 0, 0, 136, 0, 0, 291, 292,
+ 305, 307, 286, 0, 0, 294, 297, 298, 0, 121,
+ 0, 0, 0, 188, 0, 0, 184, 185, 181, 64,
+ 125, 119, 252, 0, 0, 111, 111, 0, 117, 278,
+ 0, 117, 310, 186, 187, 0, 0, 0, 226, 0,
+ 232, 0, 271, 0, 0, 281, 280, 136, 0, 0,
+ 279, 300, 183, 189, 190, 120, 269, 0, 270, 0,
+ 111, 111, 0, 0, 0, 283, 282, 0, 0, 0,
+ 0, 276, 0, 0, 275, 0, 272, 0, 0, 0
};
-static const short yydefgoto[] = { 84,
- 254, 270, 271, 272, 273, 192, 193, 222, 194, 23,
- 13, 35, 442, 306, 387, 406, 329, 388, 85, 86,
- 195, 88, 89, 118, 204, 339, 297, 340, 107, 515,
- 1, 2, 276, 249, 247, 248, 61, 173, 48, 102,
- 177, 90, 353, 282, 283, 284, 36, 94, 14, 42,
- 15, 59, 16, 26, 358, 298, 91, 300, 415, 17,
- 38, 39, 165, 490, 96, 229, 446, 447, 166, 167,
- 367, 168, 169
+static const short yydefgoto[] = { 256,
+ 257, 258, 282, 299, 156, 157, 76, 509, 12, 77,
+ 14, 15, 39, 40, 41, 45, 51, 114, 124, 326,
+ 222, 400, 329, 561, 379, 423, 542, 356, 424, 78,
+ 158, 133, 148, 134, 135, 107, 345, 368, 346, 117,
+ 85, 149, 598, 16, 17, 19, 18, 261, 334, 335,
+ 60, 22, 58, 98, 427, 428, 125, 164, 52, 93,
+ 53, 46, 430, 369, 80, 371, 266, 54, 89, 90,
+ 216, 565, 128, 305, 518, 440, 217, 218, 219, 220
};
-static const short yypact[] = {-32768,
- 118, 605,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768, -46, 131, 10,-32768,-32768, -18,-32768,-32768, 29,
- -69, 58, 51, -19,-32768, 106, 114, 144,-32768,-32768,
--32768,-32768,-32768,-32768, 1060, -20,-32768,-32768, 130,-32768,
--32768,-32768,-32768, 80, 81, 83, 94,-32768, 57, 114,
- 1060, 44, 44, 44, 44,-32768,-32768,-32768, 131,-32768,
--32768,-32768,-32768,-32768, 90,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 200,
- 201, 202, 572,-32768, 130, 99,-32768,-32768, -34,-32768,
--32768,-32768,-32768,-32768, 1231,-32768, 191, 77, 212, 193,
- 194,-32768,-32768,-32768,-32768,-32768, 1101, 1101, 1101, 1142,
--32768,-32768, 104, 107,-32768,-32768, -34, -74, 109, 852,
--32768,-32768, 1101,-32768, 165, 1183, 30, 93, 131,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101,-32768,-32768, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 1101,-32768, 131,-32768, 62,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768, -72,-32768,-32768,-32768,
- 142, 170, 221, 173, 222, 175, 223, 178, 224, 231,
- 232, 183, 225, 233, 425,-32768, 1101, 1101, 1101,-32768,
- 893,-32768, 120, 128, 638,-32768,-32768, 90,-32768, 638,
- 638,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768, 638, 1060, 121, 132,-32768, 638, 129, 134, 214,
- 141, 143, 146, 147, 148, 149, 150, 638, 638, 638,
- 151, 1060, 1101, 1101, 228,-32768, 152, 152, 152,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 153,
- 154, 155, 156, 159, 160, 934, 1142, 592, 230, 161,
- 164, 177, 180,-32768,-32768, 152, -37, -99, -34,-32768,
- 130,-32768, 184, 174, 978,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768, 227, 1142,-32768,-32768,-32768,-32768,
- 186,-32768, 187, 638, 2,-32768, 3,-32768, 188, 638,
- 179, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 189,
- 190, 195, 1101, 638, 638, 196,-32768, -23,-32768,-32768,
--32768, 1142, 1142, 1142, 1142, 1142, 1142,-32768,-32768, -30,
- 21,-32768, -73,-32768, 1142, 1142, 1142, 1142,-32768,-32768,
--32768,-32768,-32768, 1019, 229,-32768,-32768, 240, 24, 280,
- 286, 197, 638, 307, 638, 1101,-32768, 203, 638,-32768,
- 205,-32768,-32768, 210, 211,-32768,-32768, 638, 638, 638,
--32768, 215,-32768, 1101, 288, 318,-32768, 152, 188, 290,
- 218, 219, 220, 226, 1142,-32768,-32768,-32768, 234, 237,
- 241, 242,-32768,-32768,-32768, 284, 243,-32768, 638, 638,
- 1101, 246,-32768, 246,-32768, 247, 638, 248, 1101, 1101,
- 1101,-32768,-32768,-32768, 1101, 638,-32768,-32768,-32768, 252,
- 1101, 1142, 1142, 1142, 1142,-32768, 1142, 1142, 1142, 1142,
- 338,-32768, 319, 249, 236, 247, 253, 303,-32768,-32768,
- 1101, 245, 638,-32768,-32768,-32768, 254,-32768,-32768, 256,
- 260, 259, 263, 265, 264, 267, 270, 274,-32768,-32768,
- 357, 14, 355,-32768,-32768, 276,-32768,-32768, 1142,-32768,
- 1142, 1142,-32768,-32768,-32768,-32768, 638,-32768, 742, 52,
- 372,-32768, 281, 282, 287,-32768, 289,-32768, 742, 638,
--32768,-32768,-32768, 376, 291, 326, 638, 382, 383,-32768,
- 638, 638,-32768,-32768, 405, 406,-32768
+static const short yypact[] = { 42,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, -8, -110, 13,
+ -39, 104, 5, 167,-32768, 321,-32768, 83, 74, 12,
+ 17,-32768, 41, 148,-32768, 1305,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 117, 117,
+ 11,-32768,-32768,-32768, 117,-32768,-32768,-32768,-32768,-32768,
+ 117, 154,-32768, -10, 181, 204, 212,-32768,-32768,-32768,
+-32768,-32768, 98,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, 254, 259, 3, 958,-32768,-32768,-32768, 49,-32768,
+ 231, 231, 225,-32768, 65, 215, 215,-32768,-32768, 131,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, -34, 1038,-32768,
+ 120, 128, 976, 98,-32768, 49, -123,-32768, 1038, 65,
+ 65,-32768,-32768, 1056,-32768,-32768, 1327, 280,-32768,-32768,
+-32768,-32768,-32768, 1345,-32768, -16, 1663,-32768, 263,-32768,
+-32768, 49,-32768, 139, 136, 1398, 1398, 132, -95, 1398,
+-32768, 143, 1327, 1398, 98, 145, 49, 213,-32768, 50,
+ 287, 289, 298, 299, 300, 219, 304, 805,-32768,-32768,
+ 233,-32768,-32768,-32768,-32768,-32768, 260, 1496, 70, 303,
+ 215,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 396, 449,
+ 1398, 1398, 1398, 1398,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768, 1398, 1398, 1398, 1398,
+ 1398, 1398, 1398, 1398, 1398,-32768, 215,-32768, 125,-32768,
+-32768, -32, 1078,-32768, 23, -105,-32768, 160, 49,-32768,
+-32768, 49, 1056,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768, 396, 449, 168, 169, 170, 173,
+ 174, 1229, 1514, 998, 295, 175, 179, 183,-32768,-32768,
+ 187, 185,-32768, 98, 646,-32768, 780, 780,-32768, 780,
+ 1345,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, 1398,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1398, 97,
+ 102,-32768, 646, 24, 195, 203, 208, 209, 210, 211,
+ 646, 646, 332, 1345, 1398, 1398,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 10,-32768,
+-32768,-32768, 10, 187, 187, 333, 186, 223, 1327, 1327,
+ 1327, 1327, 1327,-32768,-32768, -15, 1016, -55,-32768, -79,
+-32768, 1327, 1327, 1327, -4,-32768, 1247,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 317, 1327,-32768,-32768,-32768,
+-32768, 234,-32768, 235, 780, 646, 646, 4,-32768, 22,
+-32768,-32768, 780, 207, 1398, 1398, 1398, 1398, 1398, 236,
+ 240, 1398, 780, 646, 241,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 1398, 1327, 1327,-32768, 244, 246, 247, 251,
+ 1327,-32768, 224, 805, -78,-32768,-32768, 252, 253, 363,
+ 380, 399,-32768, 187,-32768, 49, 257, 256,-32768, 386,
+ -52, 392, 393, 261, 270, 275, 780, 422, 780, 282,
+ 283, 780, 284, 49,-32768, 285, 288, 780, 780, 49,
+ 277, 290, 1398, 30, 291, 292, -80, 1327, 1327, 1327,
+ 1327,-32768,-32768, 293, 1327, 1327, 1398,-32768,-32768,-32768,
+ 278, 1287,-32768, 294,-32768, 780, 780, 1554, 780, 780,
+ 290,-32768, 290, 1398, 780, 296, 1398, 1398, 1398,-32768,
+-32768, 1554, 383,-32768, 646,-32768, 1327, 1327,-32768, 297,
+ 301, 307, 308,-32768, 305, 309, 68,-32768,-32768,-32768,
+ 49, -11, 418, 314, 313, 780, 646, -9,-32768,-32768,
+-32768,-32768,-32768, 312, 780,-32768,-32768,-32768, 44, 290,
+ 318, 319, 1327,-32768, 1327, 1327,-32768,-32768,-32768, 278,
+-32768, 395,-32768, 428, -7,-32768,-32768, 1572,-32768,-32768,
+ 320,-32768,-32768,-32768,-32768, 322, 328, 329,-32768, 442,
+-32768, 780,-32768, 503, -2, -32, -32, 780, 646, 1,
+-32768, 10,-32768,-32768,-32768,-32768,-32768, 325,-32768, 503,
+-32768,-32768, 433, 451, 334, -32, -32, 780, 780, 466,
+ 413,-32768, 780, 479,-32768, 780,-32768, 500, 501,-32768
};
-static const short yypgoto[] = {-32768,
--32768, 312, 313, 314, 315, -127, -126, -458,-32768, 373,
- 388, -116,-32768, -221, 59,-32768, -241,-32768, -48,-32768,
- -35,-32768, -62, 293,-32768, -100, 239, -226, 91,-32768,
--32768,-32768,-32768,-32768,-32768,-32768, 365,-32768,-32768,-32768,
--32768, 4,-32768, 63,-32768,-32768, 359,-32768,-32768,-32768,
--32768,-32768, 417,-32768,-32768, -414, -55, 64, -103,-32768,
- 403,-32768,-32768,-32768,-32768,-32768, 55, -3,-32768,-32768,
- 34,-32768,-32768
+static const short yypgoto[] = { 375,
+ 376, 377, 264, 262, -168,-32768, 0, -30, 421, 18,
+-32768,-32768,-32768,-32768, 43,-32768,-32768,-32768, -158,-32768,
+ -420,-32768, -222,-32768, -287, 2,-32768, -294,-32768,-32768,
+ -25, 302, -107,-32768, 404, 414, -112, -155, -233, 144,
+ 189, 286,-32768,-32768, 502,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768, 434,-32768,-32768,-32768,
+-32768,-32768,-32768, -542, -111, 122, -183,-32768, 468,-32768,
+-32768,-32768,-32768,-32768, 28, 118,-32768,-32768,-32768,-32768
};
-#define YYLAST 1339
-
-
-static const short yytable[] = { 87,
- 220, 221, 104, 308, 37, 24, 330, 331, 92, 196,
- 385, 40, 223, 489, 27, 87, 363, 365, 351, 206,
- 117, 121, 209, 212, 213, 214, 215, 216, 217, 218,
- 219, 499, 37, 386, 349, 199, 395, 245, 210, 49,
- 341, 343, 24, 246, 226, 200, 398, 230, 231, 242,
- 211, 232, 233, 234, 235, 236, 237, 117, 364, 364,
- 241, 212, 213, 214, 215, 216, 217, 218, 219, 359,
- 51, 178, 179, 180, 497, 105, 106, -64, 350, 395,
- 44, 45, 46, 121, 505, 396, 121, 205, 119, 56,
- 205, 5, 6, 7, 8, 52, 10, 53, 93, 47,
- 54, 41, 212, 213, 214, 215, 216, 217, 218, 219,
- 224, 225, 205, 227, 228, 205, 205, -126, 50, 205,
- 205, 205, 205, 205, 205, 238, 239, 240, 205, 488,
- 395, 171, 172, 395, 277, 278, 279, 60, 397, 275,
- 326, 408, 3, 108, 109, 110, 429, 62, 4, 299,
- 57, 18, 58, 19, 299, 299, 243, 244, 5, 6,
- 7, 8, 9, 10, 11, 281, 299, 498, 250, 251,
- 101, 299, -24, -24, 304, -23, -23, -22, -22, 12,
- -21, -21, 299, 299, 299, 252, 253, 87, 97, 98,
- 449, 99, 450, 324, 28, 29, 30, 31, 32, 33,
- 34, -65, 100, 112, 113, 114, 87, 325, 205, 371,
- 120, 373, 374, 375, 170, 174, 175, 176, 197, 381,
- 201, 198, 279, 207, -28, -27, -26, -25, 255, 285,
- 305, 389, 390, 391, 392, 393, 394, -31, -32, 256,
- 286, 307, 310, 311, 399, 400, 401, 402, 299, 312,
- 313, 327, 314, 344, 299, 315, 316, 317, 318, 319,
- 323, 328, 385, 407, 332, 333, 334, 335, 299, 299,
- 336, 337, 345, 301, 302, 346, 370, 205, 372, 205,
- 205, 205, 376, 377, 352, 303, 355, 205, 347, 357,
- 309, 348, 369, 354, 436, 360, 361, 366, 378, 379,
- 409, 320, 321, 322, 380, 384, 410, 299, 411, 299,
- 413, 427, 417, 299, 419, 454, 455, 456, 281, 420,
- 421, 428, 299, 299, 299, 431, 425, 432, 433, 434,
- 205, 461, 462, 463, 464, 435, 465, 466, 467, 468,
- 441, 469, 470, 437, 220, 221, 438, 474, 426, 472,
- 439, 440, 443, 299, 299, 448, 451, 453, 471, 364,
- 475, 299, 220, 221, 459, 473, 477, 362, 478, 479,
- 299, 480, 481, 368, 482, 205, 483, 487, 493, 484,
- 494, 495, 485, 205, 205, 205, 486, 382, 383, 205,
- 491, 492, 500, 501, 502, 460, 507, 299, 504, 503,
- 508, 509, 511, 512, 516, 517, 161, 162, 163, 164,
- 55, 95, 203, 405, 103, 205, 404, 111, 25, 43,
- 416, 457, 430, 0, 0, 0, 412, 0, 414, 63,
- 64, 299, 418, 274, 0, 0, 0, 0, 0, 0,
- 0, 422, 423, 424, 299, 0, 18, 0, 19, 0,
- 257, 299, 0, 0, 0, 299, 299, 0, 0, 0,
- 0, 0, 258, 259, 0, 0, 0, 0, 0, 0,
- 0, 0, 444, 445, 0, 0, 0, 0, 0, 0,
- 452, 0, 0, 0, 0, 0, 0, 0, 0, 458,
+#define YYLAST 1796
+
+
+static const short yytable[] = { 11,
+ 79, 270, 259, 269, 159, 471, 102, 333, 269, 302,
+ 88, 162, 271, 381, 437, 11, 161, 13, 91, 348,
+ 350, 578, 421, 140, 306, 307, 308, 309, 310, 421,
+ 231, 313, 439, 13, 141, 23, 234, 585, 583, 401,
+ 402, -200, 108, 20, 109, 83, 260, 84, 422, 106,
+ 331, 140, -54, -54, -54, -54, 438, 21, 314, -66,
+ 1, 2, 228, 3, 4, 5, 484, 411, 411, 24,
+ 499, 6, 7, 132, 438, 235, 236, 106, 417, 464,
+ 267, 81, 82, 132, 317, 318, 268, 86, 147, 11,
+ 540, 411, 8, 87, 411, 9, 115, 116, 147, 10,
+ 416, 319, 320, 475, 321, 322, 25, 323, 324, 325,
+ 225, 226, 129, 415, 229, 47, 48, 49, 232, 130,
+ 50, 26, 396, 397, 398, 566, 567, 399, 43, 470,
+ 44, 411, 395, 431, 396, 397, 398, 548, 412, 399,
+ 163, 549, 265, 396, 397, 398, 563, 92, 399, 1,
+ 27, 579, 3, 370, 5, 370, 370, 55, 370, 103,
+ 586, 587, 56, 375, 494, 300, 301, 265, 303, 59,
+ 108, 108, 109, 109, 88, 383, 330, 108, 262, 109,
+ 496, 304, 265, 265, 265, 265, 265, 311, 312, 265,
+ 548, 370, 57, 521, 552, 522, 108, 132, 109, 370,
+ 370, 443, 95, 445, 446, 447, 393, 147, 28, 29,
+ 30, 31, 32, 33, 34, 108, 35, 109, 539, 61,
+ 62, 237, 238, 239, 240, 96, 406, 407, 408, 409,
+ 410, 1, 2, 97, 3, 4, 5, 315, 316, 418,
+ 419, 420, 553, 378, 108, 147, 109, 99, 380, 108,
+ 512, 109, 2, 143, 144, 4, 376, 100, 259, 36,
+ 37, 38, 101, 370, 370, 370, 112, 84, 113, 110,
+ 111, 370, 136, 377, 118, 119, 120, 121, 122, 123,
+ 137, 370, 370, 160, 221, 223, 224, 227, 147, 394,
+ 265, 455, 456, 230, 233, -55, 1, -56, 462, 3,
+ 523, 5, 260, 526, 527, 528, -59, -58, -57, 36,
+ 37, 38, 241, 269, 263, 332, 351, 339, 340, 341,
+ -199, 414, 342, 343, 352, 370, 570, 370, 353, 572,
+ 370, 426, 354, 355, 357, 404, 370, 370, -66, 1,
+ 2, 384, 3, 4, 5, 500, 501, 502, 503, 385,
+ 6, 7, 505, 506, 386, 387, 388, 389, 442, 265,
+ 444, 265, 265, 265, 370, 370, 450, 370, 370, 392,
+ 403, 8, 405, 370, 9, 429, 564, 454, 10, 463,
+ 432, 433, 448, 370, 531, 532, 449, 453, 372, 373,
+ 458, 374, 459, 460, 317, 318, 580, 461, 465, 466,
+ 467, 468, 469, 472, 370, 370, 473, 474, 476, 477,
+ 478, 319, 320, 370, 321, 322, 479, 323, 324, 325,
+ 556, 480, 557, 558, 382, 482, 492, 495, 484, 485,
+ 487, 488, 390, 391, 489, 438, 493, 497, 498, 543,
+ 513, 507, 525, 533, 562, 576, 511, 560, 504, 588,
+ 370, 534, 517, 535, 536, 537, 370, 370, 265, 538,
+ 544, 265, 265, 265, 545, 550, 517, 589, 554, 555,
+ 508, 584, 573, 571, 283, 284, 370, 370, 574, 575,
+ 590, 370, 593, 594, 370, 272, 273, 274, 275, 276,
+ 277, 278, 279, 280, 281, 596, 434, 435, 436, 599,
+ 600, 213, 214, 215, 441, 358, 359, 338, 337, 559,
+ 127, 360, 142, 541, 451, 452, 139, 42, 336, 529,
+ 126, 94, 569, 457, 328, 0, 0, 361, 362, 363,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 508,
+ 0, 0, 364, 365, 285, 286, 287, 288, 289, 290,
+ 291, 292, 293, 294, 295, 296, 297, 298, 481, 366,
+ 483, 0, 0, 486, 0, 0, 0, 0, 0, 490,
+ 491, 0, 0, 0, 0, 174, 175, 176, 177, 178,
+ 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
+ 245, 246, 0, 0, 0, 0, 0, 514, 515, 0,
+ 519, 520, 0, 0, 0, 0, 524, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 530, 247, 195, 196,
+ 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
+ 0, 248, 0, 249, 250, 251, 0, 546, 547, 0,
+ 0, 0, 0, 0, 0, 0, 551, 0, 358, 359,
+ 0, 0, 61, 62, 360, 0, 0, 367, 0, 0,
+ 0, 0, 0, 0, 1, 2, 0, 3, 4, 5,
+ 361, 362, 363, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 577, 0, 364, 365, 0, 0, 581,
+ 582, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 366, 0, 0, 0, 0, 0, 0, 591,
+ 592, 0, 0, 0, 595, 0, 0, 597, 174, 175,
+ 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
+ 186, 187, 188, 245, 246, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 132, 133, 134, 135, 136, 137, 138, 139,
- 140, 141, 142, 143, 144, 145, 476, 0, 0, 0,
- 0, 260, 0, 261, 262, 153, 154, 0, 263, 264,
- 265, 0, 0, 0, 0, 0, 0, 0, 266, 0,
- 0, 267, 0, 268, 0, 0, 269, 0, 0, 0,
- 496, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 506, 0, 0, 0, 0, 0, 0,
- 510, 0, 0, 0, 513, 514, 63, 64, 0, 115,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 18, 0, 19, 63, 64, 0, 115,
- 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
- 191, 77, 78, 18, 0, 19, 0, 0, 0, 79,
- 0, 0, 0, 0, -34, 0, 18, 0, 19, 0,
- 0, 0, 0, 0, 0, 4, -34, -34, 0, 79,
- 287, 288, 63, 64, 289, -34, -34, -34, -34, -34,
- -34, -34, 0, 0, -34, 20, 0, 0, 0, 18,
- 0, 19, 21, 290, 291, 292, 22, 0, 0, 0,
- 0, 0, 0, 0, 0, 293, 294, 0, 0, 0,
- 0, 0, 80, 0, 0, 81, 0, 0, 82, 0,
- 83, 116, 0, 0, 0, 0, 0, 0, 295, 0,
- 0, 0, 80, 0, 0, 81, 0, 0, 82, 0,
- 83, 342, 0, 0, 0, 132, 133, 134, 135, 136,
- 137, 138, 139, 140, 141, 142, 143, 144, 145, 0,
- 0, 0, 0, 0, 260, 0, 261, 262, 153, 154,
- 0, 263, 264, 265, 287, 288, 0, 0, 289, 0,
- 0, 0, 0, 0, 296, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 290, 291, 292,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 293,
- 294, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 295, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 132,
- 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
- 143, 144, 145, 0, 0, 0, 0, 0, 260, 0,
- 261, 262, 153, 154, 0, 263, 264, 265, 0, 0,
- 0, 0, 0, 0, 0, 0, 63, 64, 296, 115,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 18, 0, 19, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 202, 0,
- 0, 0, 0, 0, 0, 0, 0, 63, 64, 79,
- 115, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 18, 0, 19, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 280,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 64,
- 79, 115, 181, 182, 183, 184, 185, 186, 187, 188,
- 189, 190, 191, 77, 78, 18, 0, 19, 0, 0,
- 0, 0, 80, 0, 0, 81, 0, 0, 82, 0,
- 83, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 79, 63, 64, 0, 115, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 18,
- 0, 19, 0, 80, 0, 0, 81, 0, 0, 82,
- 0, 83, 0, 0, 356, 0, 0, 0, 0, 0,
- 0, 0, 0, 63, 64, 79, 115, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 18, 0, 19, 0, 80, 0, 0, 81, 0, 338,
- 82, 0, 83, 0, 0, 403, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 64, 79, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 18, 0, 19, 0, 0, 0, 0, 80, 0,
- 0, 81, 0, 0, 82, 0, 83, 0, 0, 0,
- 0, 0, 0, 0, 0, 63, 64, 79, 115, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 18, 0, 19, 0, 0, 0, 0, 80,
- 0, 0, 81, 0, 0, 82, 0, 83, 0, 0,
- 0, 0, 0, 0, 0, 0, 63, 64, 79, 115,
- 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
- 191, 77, 78, 18, 0, 19, 0, 0, 0, 0,
- 80, 0, 0, 81, 0, 0, 82, 0, 83, 0,
- 0, 0, 0, 0, 0, 0, 0, 63, 64, 79,
- 208, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 18, 0, 19, 0, 0, 0,
- 0, 80, 0, 0, 81, 0, 0, 82, 0, 83,
+ 247, 195, 196, 197, 198, 199, 200, 201, 202, 203,
+ 204, 205, 206, 0, 248, 0, 249, 250, 251, 0,
+ 0, 0, 358, 359, 0, 0, 61, 62, 360, 0,
+ 0, 0, 0, 108, 0, 109, 0, 0, 1, 2,
+ 367, 3, 4, 5, 361, 362, 363, 0, 0, 0,
+ 0, 61, 62, 0, 0, 0, 0, 0, 0, 364,
+ 365, 0, 0, 1, 2, 0, 3, 4, 5, 242,
+ 0, 0, 0, 0, 0, 0, 366, 0, 0, 0,
+ 0, 0, 0, 0, 243, 244, 0, 0, 0, 0,
+ 0, 0, 174, 175, 176, 177, 178, 179, 180, 181,
+ 182, 183, 184, 185, 186, 187, 188, 245, 246, 0,
+ 0, 0, 0, 0, 0, 0, 0, 174, 175, 176,
+ 177, 178, 179, 180, 181, 182, 183, 184, 185, 186,
+ 187, 188, 245, 246, 247, 195, 196, 197, 198, 199,
+ 200, 201, 202, 203, 204, 205, 206, 0, 248, 0,
+ 249, 250, 251, 0, 0, 0, 0, 0, 0, 247,
+ 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
+ 205, 206, 0, 248, 367, 249, 250, 251, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 108, 0, 109, 0, 252, 0, 0, 253,
+ 0, 254, 0, 255, 61, 62, 0, 104, 64, 65,
+ 66, 67, 68, 69, 70, 0, 1, 2, 0, 3,
+ 4, 5, 61, 62, 0, 104, 64, 65, 66, 67,
+ 68, 69, 70, 0, 1, 2, 0, 3, 4, 5,
+ 0, 0, 0, 0, 61, 62, 71, 104, 150, 151,
+ 152, 153, 154, 155, 70, 0, 1, 2, 0, 3,
+ 4, 5, 61, 62, 71, 104, 150, 151, 152, 153,
+ 154, 155, 70, 0, 1, 2, 0, 3, 4, 5,
+ 0, 0, 0, 0, 61, 62, 71, 104, 64, 65,
+ 66, 67, 68, 69, 70, 0, 1, 2, 0, 3,
+ 4, 5, 61, 62, 71, 145, 64, 65, 66, 67,
+ 68, 69, 70, 0, 1, 2, 131, 3, 4, 5,
+ 0, 0, 0, 0, 61, 62, 71, 104, 64, 65,
+ 66, 67, 68, 69, 70, 0, 1, 2, 0, 3,
+ 4, 5, 0, 0, 71, 0, 72, 0, 0, 73,
+ 0, 0, 74, 0, 75, 105, 327, 0, 0, 0,
+ 0, 0, 0, 0, 72, 0, 71, 73, 0, 0,
+ 74, 0, 75, 138, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 72, 0, 0, 73,
+ 0, 0, 74, 0, 75, 349, 0, 0, 0, 0,
+ 0, 0, 0, 0, 72, 0, 0, 73, 0, 0,
+ 74, 0, 75, 413, 0, 0, 146, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 72, 0, 0, 73,
+ 0, 0, 74, 0, 75, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 72, 0, 0, 73, 0, 0,
+ 74, 0, 75, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 72, 0, 0, 73,
+ 0, 0, 74, 0, 75, 61, 62, 0, 104, 150,
+ 151, 152, 153, 154, 155, 70, 0, 1, 2, 0,
+ 3, 4, 5, 61, 62, 0, 104, 64, 65, 66,
+ 67, 68, 69, 70, 0, 1, 2, 0, 3, 4,
+ 5, 0, 0, 0, 0, 0, 0, 71, 0, 0,
+ 0, 0, 0, 0, 0, 425, 0, 0, 0, 0,
+ 0, 0, 0, 61, 62, 71, 104, 64, 65, 66,
+ 67, 68, 69, 70, 0, 1, 2, 0, 3, 4,
+ 5, 61, 62, 0, 63, 64, 65, 66, 67, 68,
+ 69, 70, 0, 1, 2, 510, 3, 4, 5, 0,
+ 0, 0, 0, 61, 62, 71, 104, 150, 151, 152,
+ 153, 154, 155, 70, 0, 1, 2, 0, 3, 4,
+ 5, 61, 62, 71, 145, 64, 65, 66, 67, 68,
+ 69, 70, 0, 1, 2, 0, 3, 4, 5, 0,
+ 0, 0, 0, 0, 0, 71, 0, 72, 0, 0,
+ 73, 0, 344, 74, 0, 75, 0, 0, 0, 0,
+ 0, 0, 0, 71, 0, 72, 0, 0, 73, 0,
+ 0, 74, 0, 75, 61, 62, 0, 104, 64, 65,
+ 66, 67, 68, 69, 70, 0, 1, 2, 0, 3,
+ 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 72, 0, 0, 73, 0,
+ 0, 74, 0, 75, 0, 0, 71, 0, 0, 0,
+ 0, 0, 0, 72, 0, 0, 73, 0, 0, 74,
+ 0, 75, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 72, 0, 0, 73, 0,
+ 0, 74, 0, 75, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 72, 0, 0, 73, 0, 0, 74,
+ 0, 75, 61, 62, 0, 264, 64, 65, 66, 67,
+ 68, 69, 70, 0, 1, 2, 0, 3, 4, 5,
+ 61, 62, 0, 104, 150, 151, 152, 153, 154, 155,
+ 70, 0, 1, 2, 0, 3, 4, 5, 0, 0,
+ 0, 0, 0, 0, 71, 0, 72, 0, 0, 73,
+ 0, 0, 74, 0, 75, 0, 0, 0, 0, 0,
+ 61, 62, 71, 104, 64, 65, 66, 67, 68, 69,
+ 516, 0, 1, 2, 0, 3, 4, 5, 61, 62,
+ 0, 104, 64, 65, 66, 67, 68, 69, 568, 0,
+ 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
+ 0, 0, 71, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 71, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 72, 0, 0, 73, 0, 0,
+ 74, 0, 75, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 72, 0, 0, 73, 0, 0, 74, 0,
+ 347, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 165, 0,
+ 0, 0, 72, 0, 0, 73, 0, 0, 74, 0,
+ 75, 0, 0, 0, 0, 0, 0, 166, 167, 0,
+ 72, 0, 0, 73, 0, 0, 74, 0, 75, 168,
+ 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
+ 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
+ 189, 190, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 80, 0, 0, 81, 0, 0, 82, 0,
- 83, 0, 0, 0, 0, 122, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 123,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 124,
- 125, 0, 0, 80, 0, 0, 81, 0, 0, 82,
- 0, 83, 126, 127, 128, 129, 130, 131, 132, 133,
- 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
- 144, 145, 146, 147, 148, 0, 0, 149, 150, 151,
- 152, 153, 154, 155, 156, 157, 158, 159, 160
+ 0, 0, 191, 192, 193, 0, 0, 194, 195, 196,
+ 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
+ 207, 208, 209, 210, 211, 212
};
-static const short yycheck[] = { 35,
- 128, 128, 51, 225, 23, 2, 248, 249, 29, 110,
- 34, 30, 129, 472, 61, 51, 15, 15, 118, 123,
- 83, 121, 126, 10, 11, 12, 13, 14, 15, 16,
- 17, 490, 23, 57, 276, 110, 110, 110, 9, 109,
- 267, 268, 39, 116, 148, 120, 120, 151, 152, 166,
- 21, 155, 156, 157, 158, 159, 160, 120, 57, 57,
- 164, 10, 11, 12, 13, 14, 15, 16, 17, 296,
- 20, 107, 108, 109, 489, 32, 33, 112, 116, 110,
- 52, 53, 54, 121, 499, 116, 121, 123, 85, 109,
- 126, 41, 42, 43, 44, 45, 46, 47, 119, 71,
- 50, 120, 10, 11, 12, 13, 14, 15, 16, 17,
- 146, 147, 148, 149, 150, 151, 152, 0, 61, 155,
- 156, 157, 158, 159, 160, 161, 162, 163, 164, 116,
- 110, 55, 56, 110, 197, 198, 199, 24, 118, 195,
- 244, 118, 25, 53, 54, 55, 388, 4, 31, 205,
- 45, 22, 47, 24, 210, 211, 95, 96, 41, 42,
- 43, 44, 45, 46, 47, 201, 222, 116, 27, 28,
- 114, 227, 3, 4, 223, 3, 4, 3, 4, 62,
- 3, 4, 238, 239, 240, 3, 4, 223, 109, 109,
- 412, 109, 414, 242, 64, 65, 66, 67, 68, 69,
- 70, 112, 109, 4, 4, 4, 242, 243, 244, 313,
- 112, 315, 316, 317, 24, 4, 24, 24, 115, 323,
- 112, 115, 285, 59, 4, 4, 4, 4, 4, 110,
- 110, 332, 333, 334, 335, 336, 337, 7, 7, 7,
- 113, 110, 114, 110, 345, 346, 347, 348, 304, 36,
- 110, 24, 110, 24, 310, 110, 110, 110, 110, 110,
- 110, 110, 34, 24, 112, 112, 112, 112, 324, 325,
- 112, 112, 112, 210, 211, 112, 312, 313, 314, 315,
- 316, 317, 318, 319, 281, 222, 113, 323, 112, 63,
- 227, 112, 114, 110, 395, 110, 110, 110, 110, 110,
- 21, 238, 239, 240, 110, 110, 21, 363, 112, 365,
- 4, 24, 110, 369, 110, 419, 420, 421, 354, 110,
- 110, 4, 378, 379, 380, 36, 112, 110, 110, 110,
- 366, 432, 433, 434, 435, 110, 437, 438, 439, 440,
- 57, 4, 24, 110, 472, 472, 110, 451, 384, 114,
- 110, 110, 110, 409, 410, 110, 110, 110, 110, 57,
- 116, 417, 490, 490, 113, 113, 113, 304, 113, 110,
- 426, 113, 110, 310, 110, 411, 113, 21, 479, 113,
- 481, 482, 113, 419, 420, 421, 113, 324, 325, 425,
- 36, 116, 21, 113, 113, 431, 21, 453, 110, 113,
- 110, 76, 21, 21, 0, 0, 95, 95, 95, 95,
- 23, 39, 120, 355, 50, 451, 354, 59, 2, 17,
- 366, 425, 389, -1, -1, -1, 363, -1, 365, 5,
- 6, 487, 369, 195, -1, -1, -1, -1, -1, -1,
- -1, 378, 379, 380, 500, -1, 22, -1, 24, -1,
- 26, 507, -1, -1, -1, 511, 512, -1, -1, -1,
- -1, -1, 38, 39, -1, -1, -1, -1, -1, -1,
- -1, -1, 409, 410, -1, -1, -1, -1, -1, -1,
- 417, -1, -1, -1, -1, -1, -1, -1, -1, 426,
+static const short yycheck[] = { 0,
+ 26, 170, 158, 11, 117, 426, 4, 230, 11, 193,
+ 21, 28, 171, 301, 11, 16, 124, 0, 29, 253,
+ 254, 564, 34, 147, 208, 209, 210, 211, 212, 34,
+ 143, 215, 11, 16, 158, 146, 148, 580, 38, 334,
+ 335, 0, 148, 52, 150, 35, 158, 37, 53, 75,
+ 156, 147, 3, 4, 5, 6, 53, 66, 217, 18,
+ 19, 20, 158, 22, 23, 24, 147, 147, 147, 57,
+ 151, 30, 31, 99, 53, 26, 27, 103, 158, 158,
+ 11, 39, 40, 109, 117, 118, 17, 45, 114, 90,
+ 511, 147, 51, 51, 147, 54, 32, 33, 124, 58,
+ 156, 134, 135, 156, 137, 138, 146, 140, 141, 142,
+ 136, 137, 147, 347, 140, 42, 43, 44, 144, 154,
+ 47, 18, 134, 135, 136, 546, 547, 139, 46, 424,
+ 48, 147, 316, 367, 134, 135, 136, 147, 154, 139,
+ 157, 151, 168, 134, 135, 136, 154, 158, 139, 19,
+ 146, 154, 22, 265, 24, 267, 268, 146, 270, 157,
+ 581, 582, 146, 271, 452, 191, 192, 193, 194, 22,
+ 148, 148, 150, 150, 21, 152, 154, 148, 161, 150,
+ 151, 207, 208, 209, 210, 211, 212, 213, 214, 215,
+ 147, 303, 152, 481, 151, 483, 148, 223, 150, 311,
+ 312, 385, 22, 387, 388, 389, 314, 233, 42, 43,
+ 44, 45, 46, 47, 48, 148, 50, 150, 151, 7,
+ 8, 3, 4, 5, 6, 22, 339, 340, 341, 342,
+ 343, 19, 20, 22, 22, 23, 24, 113, 114, 352,
+ 353, 354, 530, 147, 148, 271, 150, 150, 147, 148,
+ 473, 150, 20, 110, 111, 23, 282, 4, 414, 143,
+ 144, 145, 4, 375, 376, 377, 42, 37, 44, 81,
+ 82, 383, 153, 299, 60, 61, 62, 63, 64, 65,
+ 153, 393, 394, 4, 22, 147, 151, 156, 314, 315,
+ 316, 404, 405, 151, 150, 9, 19, 9, 411, 22,
+ 484, 24, 414, 487, 488, 489, 9, 9, 9, 143,
+ 144, 145, 9, 11, 55, 156, 22, 150, 150, 150,
+ 0, 347, 150, 150, 150, 437, 549, 439, 150, 552,
+ 442, 357, 150, 147, 150, 150, 448, 449, 18, 19,
+ 20, 147, 22, 23, 24, 458, 459, 460, 461, 147,
+ 30, 31, 465, 466, 147, 147, 147, 147, 152, 385,
+ 386, 387, 388, 389, 476, 477, 392, 479, 480, 38,
+ 38, 51, 150, 485, 54, 59, 545, 403, 58, 156,
+ 147, 147, 147, 495, 497, 498, 147, 147, 267, 268,
+ 147, 270, 147, 147, 117, 118, 565, 147, 147, 147,
+ 38, 22, 4, 147, 516, 517, 151, 22, 17, 17,
+ 150, 134, 135, 525, 137, 138, 147, 140, 141, 142,
+ 533, 147, 535, 536, 303, 4, 150, 453, 147, 147,
+ 147, 147, 311, 312, 147, 53, 147, 147, 147, 22,
+ 147, 467, 147, 147, 17, 4, 472, 53, 156, 17,
+ 562, 151, 478, 147, 147, 151, 568, 569, 484, 151,
+ 147, 487, 488, 489, 152, 154, 492, 17, 151, 151,
+ 471, 147, 151, 154, 26, 27, 588, 589, 151, 151,
+ 147, 593, 17, 71, 596, 90, 91, 92, 93, 94,
+ 95, 96, 97, 98, 99, 17, 375, 376, 377, 0,
+ 0, 127, 127, 127, 383, 3, 4, 246, 245, 540,
+ 90, 9, 109, 512, 393, 394, 103, 16, 233, 492,
+ 87, 54, 548, 406, 223, -1, -1, 25, 26, 27,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 540,
+ -1, -1, 40, 41, 96, 97, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, 107, 108, 109, 437, 57,
+ 439, -1, -1, 442, -1, -1, -1, -1, -1, 448,
+ 449, -1, -1, -1, -1, 73, 74, 75, 76, 77,
+ 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, -1, -1, -1, -1, -1, 476, 477, -1,
+ 479, 480, -1, -1, -1, -1, 485, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 495, 115, 116, 117,
+ 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
+ -1, 129, -1, 131, 132, 133, -1, 516, 517, -1,
+ -1, -1, -1, -1, -1, -1, 525, -1, 3, 4,
+ -1, -1, 7, 8, 9, -1, -1, 155, -1, -1,
+ -1, -1, -1, -1, 19, 20, -1, 22, 23, 24,
+ 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 562, -1, 40, 41, -1, -1, 568,
+ 569, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 57, -1, -1, -1, -1, -1, -1, 588,
+ 589, -1, -1, -1, 593, -1, -1, 596, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 453, -1, -1, -1,
- -1, 97, -1, 99, 100, 101, 102, -1, 104, 105,
- 106, -1, -1, -1, -1, -1, -1, -1, 114, -1,
- -1, 117, -1, 119, -1, -1, 122, -1, -1, -1,
- 487, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 500, -1, -1, -1, -1, -1, -1,
- 507, -1, -1, -1, 511, 512, 5, 6, -1, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, -1, 24, 5, 6, -1, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, -1, 24, -1, -1, -1, 48,
- -1, -1, -1, -1, 20, -1, 22, -1, 24, -1,
- -1, -1, -1, -1, -1, 31, 32, 33, -1, 48,
- 3, 4, 5, 6, 7, 41, 42, 43, 44, 45,
- 46, 47, -1, -1, 50, 51, -1, -1, -1, 22,
- -1, 24, 58, 26, 27, 28, 62, -1, -1, -1,
- -1, -1, -1, -1, -1, 38, 39, -1, -1, -1,
- -1, -1, 111, -1, -1, 114, -1, -1, 117, -1,
- 119, 120, -1, -1, -1, -1, -1, -1, 61, -1,
- -1, -1, 111, -1, -1, 114, -1, -1, 117, -1,
- 119, 120, -1, -1, -1, 78, 79, 80, 81, 82,
- 83, 84, 85, 86, 87, 88, 89, 90, 91, -1,
- -1, -1, -1, -1, 97, -1, 99, 100, 101, 102,
- -1, 104, 105, 106, 3, 4, -1, -1, 7, -1,
- -1, -1, -1, -1, 117, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 26, 27, 28,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 38,
- 39, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 61, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 78,
- 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, 91, -1, -1, -1, -1, -1, 97, -1,
- 99, 100, 101, 102, -1, 104, 105, 106, -1, -1,
- -1, -1, -1, -1, -1, -1, 5, 6, 117, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, -1, 24, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 37, -1,
- -1, -1, -1, -1, -1, -1, -1, 5, 6, 48,
- 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, -1, 24, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
- -1, -1, -1, -1, -1, -1, -1, -1, 5, 6,
- 48, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, -1, 24, -1, -1,
- -1, -1, 111, -1, -1, 114, -1, -1, 117, -1,
- 119, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 48, 5, 6, -1, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- -1, 24, -1, 111, -1, -1, 114, -1, -1, 117,
- -1, 119, -1, -1, 37, -1, -1, -1, -1, -1,
- -1, -1, -1, 5, 6, 48, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, -1, 24, -1, 111, -1, -1, 114, -1, 116,
- 117, -1, 119, -1, -1, 37, -1, -1, -1, -1,
- -1, -1, -1, -1, 5, 6, 48, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, -1, 24, -1, -1, -1, -1, 111, -1,
- -1, 114, -1, -1, 117, -1, 119, -1, -1, -1,
- -1, -1, -1, -1, -1, 5, 6, 48, 8, 9,
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, -1, 24, -1, -1, -1, -1, 111,
- -1, -1, 114, -1, -1, 117, -1, 119, -1, -1,
- -1, -1, -1, -1, -1, -1, 5, 6, 48, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, -1, 24, -1, -1, -1, -1,
- 111, -1, -1, 114, -1, -1, 117, -1, 119, -1,
- -1, -1, -1, -1, -1, -1, -1, 5, 6, 48,
- 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, -1, 24, -1, -1, -1,
- -1, 111, -1, -1, 114, -1, -1, 117, -1, 119,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, -1, 129, -1, 131, 132, 133, -1,
+ -1, -1, 3, 4, -1, -1, 7, 8, 9, -1,
+ -1, -1, -1, 148, -1, 150, -1, -1, 19, 20,
+ 155, 22, 23, 24, 25, 26, 27, -1, -1, -1,
+ -1, 7, 8, -1, -1, -1, -1, -1, -1, 40,
+ 41, -1, -1, 19, 20, -1, 22, 23, 24, 25,
+ -1, -1, -1, -1, -1, -1, 57, -1, -1, -1,
+ -1, -1, -1, -1, 40, 41, -1, -1, -1, -1,
+ -1, -1, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
+ -1, -1, -1, -1, -1, -1, -1, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
+ 86, 87, 88, 89, 115, 116, 117, 118, 119, 120,
+ 121, 122, 123, 124, 125, 126, 127, -1, 129, -1,
+ 131, 132, 133, -1, -1, -1, -1, -1, -1, 115,
+ 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
+ 126, 127, -1, 129, 155, 131, 132, 133, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 48, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 148, -1, 150, -1, 152, -1, -1, 155,
+ -1, 157, -1, 159, 7, 8, -1, 10, 11, 12,
+ 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
+ 23, 24, 7, 8, -1, 10, 11, 12, 13, 14,
+ 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
+ -1, -1, -1, -1, 7, 8, 49, 10, 11, 12,
+ 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
+ 23, 24, 7, 8, 49, 10, 11, 12, 13, 14,
+ 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
+ -1, -1, -1, -1, 7, 8, 49, 10, 11, 12,
+ 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
+ 23, 24, 7, 8, 49, 10, 11, 12, 13, 14,
+ 15, 16, 17, -1, 19, 20, 39, 22, 23, 24,
+ -1, -1, -1, -1, 7, 8, 49, 10, 11, 12,
+ 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
+ 23, 24, -1, -1, 49, -1, 149, -1, -1, 152,
+ -1, -1, 155, -1, 157, 158, 39, -1, -1, -1,
+ -1, -1, -1, -1, 149, -1, 49, 152, -1, -1,
+ 155, -1, 157, 158, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 149, -1, -1, 152,
+ -1, -1, 155, -1, 157, 158, -1, -1, -1, -1,
+ -1, -1, -1, -1, 149, -1, -1, 152, -1, -1,
+ 155, -1, 157, 158, -1, -1, 121, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 149, -1, -1, 152,
+ -1, -1, 155, -1, 157, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 149, -1, -1, 152, -1, -1,
+ 155, -1, 157, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 149, -1, -1, 152,
+ -1, -1, 155, -1, 157, 7, 8, -1, 10, 11,
+ 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
+ 22, 23, 24, 7, 8, -1, 10, 11, 12, 13,
+ 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
+ 24, -1, -1, -1, -1, -1, -1, 49, -1, -1,
+ -1, -1, -1, -1, -1, 39, -1, -1, -1, -1,
+ -1, -1, -1, 7, 8, 49, 10, 11, 12, 13,
+ 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
+ 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
+ 16, 17, -1, 19, 20, 39, 22, 23, 24, -1,
+ -1, -1, -1, 7, 8, 49, 10, 11, 12, 13,
+ 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
+ 24, 7, 8, 49, 10, 11, 12, 13, 14, 15,
+ 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
+ -1, -1, -1, -1, -1, 49, -1, 149, -1, -1,
+ 152, -1, 154, 155, -1, 157, -1, -1, -1, -1,
+ -1, -1, -1, 49, -1, 149, -1, -1, 152, -1,
+ -1, 155, -1, 157, 7, 8, -1, 10, 11, 12,
+ 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
+ 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 149, -1, -1, 152, -1,
+ -1, 155, -1, 157, -1, -1, 49, -1, -1, -1,
+ -1, -1, -1, 149, -1, -1, 152, -1, -1, 155,
+ -1, 157, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 149, -1, -1, 152, -1,
+ -1, 155, -1, 157, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 149, -1, -1, 152, -1, -1, 155,
+ -1, 157, 7, 8, -1, 10, 11, 12, 13, 14,
+ 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
+ 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
+ -1, -1, -1, -1, 49, -1, 149, -1, -1, 152,
+ -1, -1, 155, -1, 157, -1, -1, -1, -1, -1,
+ 7, 8, 49, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, 19, 20, -1, 22, 23, 24, 7, 8,
+ -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
+ 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
+ -1, -1, 49, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 49, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 149, -1, -1, 152, -1, -1,
+ 155, -1, 157, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 149, -1, -1, 152, -1, -1, 155, -1,
+ 157, -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, 36, -1,
+ -1, -1, 149, -1, -1, 152, -1, -1, 155, -1,
+ 157, -1, -1, -1, -1, -1, -1, 55, 56, -1,
+ 149, -1, -1, 152, -1, -1, 155, -1, 157, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 111, -1, -1, 114, -1, -1, 117, -1,
- 119, -1, -1, -1, -1, 35, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 49,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
- 60, -1, -1, 111, -1, -1, 114, -1, -1, 117,
- -1, 119, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, -1, -1, 97, 98, 99,
- 100, 101, 102, 103, 104, 105, 106, 107, 108
+ -1, -1, 110, 111, 112, -1, -1, 115, 116, 117,
+ 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
+ 128, 129, 130, 131, 132, 133
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/share/bison.simple"
switch (yyn) {
-case 2:
-#line 1098 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[0].UIntVal > (uint32_t)INT32_MAX) // Outside of my range!
- GEN_ERROR("Value too large for type!");
- yyval.SIntVal = (int32_t)yyvsp[0].UIntVal;
- CHECK_FOR_ERROR
-;
+case 28:
+#line 1133 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_EQ; ;
break;}
-case 4:
-#line 1107 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[0].UInt64Val > (uint64_t)INT64_MAX) // Outside of my range!
- GEN_ERROR("Value too large for type!");
- yyval.SInt64Val = (int64_t)yyvsp[0].UInt64Val;
- CHECK_FOR_ERROR
-;
+case 29:
+#line 1133 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_NE; ;
+ break;}
+case 30:
+#line 1134 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_SLT; ;
+ break;}
+case 31:
+#line 1134 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_SGT; ;
+ break;}
+case 32:
+#line 1135 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_SLE; ;
break;}
case 33:
-#line 1131 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.StrVal = yyvsp[-1].StrVal;
- CHECK_FOR_ERROR
- ;
+#line 1135 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_SGE; ;
break;}
case 34:
-#line 1135 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.StrVal = 0;
- CHECK_FOR_ERROR
- ;
+#line 1136 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_ULT; ;
break;}
case 35:
-#line 1140 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::InternalLinkage; ;
+#line 1136 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_UGT; ;
break;}
case 36:
-#line 1141 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ;
+#line 1137 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_ULE; ;
break;}
case 37:
-#line 1142 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::WeakLinkage; ;
+#line 1137 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.IPredicate = ICmpInst::ICMP_UGE; ;
break;}
case 38:
-#line 1143 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::AppendingLinkage; ;
+#line 1141 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ;
break;}
case 39:
-#line 1144 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::DLLImportLinkage; ;
+#line 1141 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_ONE; ;
break;}
case 40:
-#line 1145 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::DLLExportLinkage; ;
+#line 1142 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_OLT; ;
break;}
case 41:
-#line 1146 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ;
+#line 1142 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_OGT; ;
break;}
case 42:
-#line 1147 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
+#line 1143 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_OLE; ;
break;}
case 43:
-#line 1149 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::C; ;
+#line 1143 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_OGE; ;
break;}
case 44:
-#line 1150 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::C; ;
+#line 1144 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_ORD; ;
break;}
case 45:
-#line 1151 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::CSRet; ;
+#line 1144 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_UNO; ;
break;}
case 46:
-#line 1152 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::Fast; ;
+#line 1145 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ;
break;}
case 47:
-#line 1153 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::Cold; ;
+#line 1145 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_UNE; ;
break;}
case 48:
-#line 1154 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::X86_StdCall; ;
+#line 1146 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_ULT; ;
break;}
case 49:
-#line 1155 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = CallingConv::X86_FastCall; ;
+#line 1146 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_UGT; ;
break;}
case 50:
-#line 1156 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val)
- GEN_ERROR("Calling conv too large!");
- yyval.UIntVal = yyvsp[0].UInt64Val;
- CHECK_FOR_ERROR
- ;
+#line 1147 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_ULE; ;
break;}
case 51:
-#line 1165 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = 0; ;
+#line 1147 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_UGE; ;
break;}
case 52:
-#line 1166 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.UIntVal = yyvsp[0].UInt64Val;
- if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal))
- GEN_ERROR("Alignment must be a power of two!");
- CHECK_FOR_ERROR
-;
+#line 1148 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ;
break;}
case 53:
-#line 1172 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.UIntVal = 0; ;
- break;}
-case 54:
-#line 1173 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.UIntVal = yyvsp[0].UInt64Val;
- if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal))
- GEN_ERROR("Alignment must be a power of two!");
- CHECK_FOR_ERROR
-;
- break;}
-case 55:
-#line 1181 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i)
- if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\')
- GEN_ERROR("Invalid character in section name!");
- yyval.StrVal = yyvsp[0].StrVal;
- CHECK_FOR_ERROR
-;
+#line 1149 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ;
break;}
-case 56:
-#line 1189 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 64:
+#line 1158 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ yyval.StrVal = 0; ;
break;}
-case 57:
-#line 1190 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.StrVal = yyvsp[0].StrVal; ;
- break;}
-case 58:
-#line 1195 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{;
- break;}
-case 59:
-#line 1196 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{;
- break;}
-case 60:
-#line 1197 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 65:
+#line 1162 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- CurGV->setSection(yyvsp[0].StrVal);
- free(yyvsp[0].StrVal);
+ yyval.StrVal = yyvsp[-1].StrVal;
CHECK_FOR_ERROR
;
break;}
-case 61:
-#line 1202 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 66:
+#line 1166 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val))
- GEN_ERROR("Alignment must be a power of two!");
- CurGV->setAlignment(yyvsp[0].UInt64Val);
+ yyval.StrVal = 0;
CHECK_FOR_ERROR
;
break;}
-case 63:
-#line 1216 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;
- break;}
-case 65:
-#line 1217 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;
- break;}
-case 66:
-#line 1219 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 70:
+#line 1174 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
- yyval.TypeVal = yyvsp[0].TypeVal;
+ yyval.StrVal = 0;
CHECK_FOR_ERROR
;
break;}
-case 80:
-#line 1231 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 71:
+#line 1179 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.TypeVal = new PATypeHolder(OpaqueType::get());
+ yyval.StrVal = yyvsp[-1].StrVal;
CHECK_FOR_ERROR
;
break;}
-case 81:
-#line 1235 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType);
- CHECK_FOR_ERROR
- ;
+case 72:
+#line 1185 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::InternalLinkage; ;
+ break;}
+case 73:
+#line 1186 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::WeakLinkage; ;
+ break;}
+case 74:
+#line 1187 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ;
+ break;}
+case 75:
+#line 1188 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::AppendingLinkage; ;
+ break;}
+case 76:
+#line 1189 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::DLLExportLinkage; ;
+ break;}
+case 77:
+#line 1193 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::DLLImportLinkage; ;
+ break;}
+case 78:
+#line 1194 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ;
+ break;}
+case 79:
+#line 1195 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
+ break;}
+case 80:
+#line 1199 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Visibility = GlobalValue::DefaultVisibility; ;
+ break;}
+case 81:
+#line 1200 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Visibility = GlobalValue::DefaultVisibility; ;
break;}
case 82:
-#line 1239 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Named types are also simple types...
- const Type* tmp = getTypeVal(yyvsp[0].ValIDVal);
+#line 1201 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Visibility = GlobalValue::HiddenVisibility; ;
+ break;}
+case 83:
+#line 1202 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Visibility = GlobalValue::ProtectedVisibility; ;
+ break;}
+case 84:
+#line 1206 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
+ break;}
+case 85:
+#line 1207 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::DLLImportLinkage; ;
+ break;}
+case 86:
+#line 1208 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ;
+ break;}
+case 87:
+#line 1212 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
+ break;}
+case 88:
+#line 1213 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::InternalLinkage; ;
+ break;}
+case 89:
+#line 1214 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ;
+ break;}
+case 90:
+#line 1215 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::WeakLinkage; ;
+ break;}
+case 91:
+#line 1216 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::DLLExportLinkage; ;
+ break;}
+case 92:
+#line 1220 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::ExternalLinkage; ;
+ break;}
+case 93:
+#line 1221 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::WeakLinkage; ;
+ break;}
+case 94:
+#line 1222 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.Linkage = GlobalValue::InternalLinkage; ;
+ break;}
+case 95:
+#line 1225 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.UIntVal = CallingConv::C; ;
+ break;}
+case 96:
+#line 1226 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.UIntVal = CallingConv::C; ;
+ break;}
+case 97:
+#line 1227 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.UIntVal = CallingConv::Fast; ;
+ break;}
+case 98:
+#line 1228 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.UIntVal = CallingConv::Cold; ;
+ break;}
+case 99:
+#line 1229 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.UIntVal = CallingConv::X86_StdCall; ;
+ break;}
+case 100:
+#line 1230 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.UIntVal = CallingConv::X86_FastCall; ;
+ break;}
+case 101:
+#line 1231 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val)
+ GEN_ERROR("Calling conv too large");
+ yyval.UIntVal = yyvsp[0].UInt64Val;
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 102:
+#line 1238 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::ZExt; ;
+ break;}
+case 103:
+#line 1239 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::ZExt; ;
+ break;}
+case 104:
+#line 1240 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::SExt; ;
+ break;}
+case 105:
+#line 1241 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::SExt; ;
+ break;}
+case 106:
+#line 1242 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::InReg; ;
+ break;}
+case 107:
+#line 1243 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::StructRet; ;
+ break;}
+case 108:
+#line 1244 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::NoAlias; ;
+ break;}
+case 109:
+#line 1245 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::ByVal; ;
+ break;}
+case 110:
+#line 1246 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::Nest; ;
+ break;}
+case 111:
+#line 1249 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::None; ;
+ break;}
+case 112:
+#line 1250 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs;
+ ;
+ break;}
+case 113:
+#line 1255 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::NoReturn; ;
+ break;}
+case 114:
+#line 1256 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::NoUnwind; ;
+ break;}
+case 115:
+#line 1257 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::ZExt; ;
+ break;}
+case 116:
+#line 1258 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::SExt; ;
+ break;}
+case 117:
+#line 1261 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamAttrs = ParamAttr::None; ;
+ break;}
+case 118:
+#line 1262 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs;
+ ;
+ break;}
+case 119:
+#line 1269 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.UIntVal = 0; ;
+ break;}
+case 120:
+#line 1270 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.UIntVal = yyvsp[0].UInt64Val;
+ if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal))
+ GEN_ERROR("Alignment must be a power of two");
CHECK_FOR_ERROR
- yyval.TypeVal = new PATypeHolder(tmp);
;
break;}
-case 83:
-#line 1247 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 121:
+#line 1276 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.UIntVal = 0; ;
+ break;}
+case 122:
+#line 1277 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.UIntVal = yyvsp[0].UInt64Val;
+ if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal))
+ GEN_ERROR("Alignment must be a power of two");
+ CHECK_FOR_ERROR
+;
+ break;}
+case 123:
+#line 1285 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ for (unsigned i = 0, e = yyvsp[0].StrVal->length(); i != e; ++i)
+ if ((*yyvsp[0].StrVal)[i] == '"' || (*yyvsp[0].StrVal)[i] == '\\')
+ GEN_ERROR("Invalid character in section name");
+ yyval.StrVal = yyvsp[0].StrVal;
+ CHECK_FOR_ERROR
+;
+ break;}
+case 124:
+#line 1293 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.StrVal = 0; ;
+ break;}
+case 125:
+#line 1294 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.StrVal = yyvsp[0].StrVal; ;
+ break;}
+case 126:
+#line 1299 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{;
+ break;}
+case 127:
+#line 1300 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{;
+ break;}
+case 128:
+#line 1301 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ CurGV->setSection(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 129:
+#line 1306 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val))
+ GEN_ERROR("Alignment must be a power of two");
+ CurGV->setAlignment(yyvsp[0].UInt64Val);
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 137:
+#line 1322 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.TypeVal = new PATypeHolder(OpaqueType::get());
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 138:
+#line 1326 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType);
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 139:
+#line 1330 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Pointer type?
+ if (*yyvsp[-1].TypeVal == Type::LabelTy)
+ GEN_ERROR("Cannot form a pointer to a basic block");
+ yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal)));
+ delete yyvsp[-1].TypeVal;
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 140:
+#line 1337 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Named types are also simple types...
+ const Type* tmp = getTypeVal(yyvsp[0].ValIDVal);
+ CHECK_FOR_ERROR
+ yyval.TypeVal = new PATypeHolder(tmp);
+ ;
+ break;}
+case 141:
+#line 1342 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Type UpReference
- if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range!");
+ if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range");
OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector...
yyval.TypeVal = new PATypeHolder(OT);
CHECK_FOR_ERROR
;
break;}
-case 84:
-#line 1255 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Function derived type?
+case 142:
+#line 1350 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
std::vector<const Type*> Params;
- for (std::list<llvm::PATypeHolder>::iterator I = yyvsp[-1].TypeList->begin(),
- E = yyvsp[-1].TypeList->end(); I != E; ++I)
- Params.push_back(*I);
+ ParamAttrsVector Attrs;
+ if (yyvsp[0].ParamAttrs != ParamAttr::None) {
+ ParamAttrsWithIndex X; X.index = 0; X.attrs = yyvsp[0].ParamAttrs;
+ Attrs.push_back(X);
+ }
+ unsigned index = 1;
+ TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end();
+ for (; I != E; ++I, ++index) {
+ const Type *Ty = I->Ty->get();
+ Params.push_back(Ty);
+ if (Ty != Type::VoidTy)
+ if (I->Attrs != ParamAttr::None) {
+ ParamAttrsWithIndex X; X.index = index; X.attrs = I->Attrs;
+ Attrs.push_back(X);
+ }
+ }
bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
if (isVarArg) Params.pop_back();
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(FunctionType::get(*yyvsp[-3].TypeVal,Params,isVarArg)));
- delete yyvsp[-1].TypeList; // Delete the argument list
- delete yyvsp[-3].TypeVal; // Delete the return type handle
+ ParamAttrsList *ActualAttrs = 0;
+ if (!Attrs.empty())
+ ActualAttrs = ParamAttrsList::get(Attrs);
+ FunctionType *FT = FunctionType::get(*yyvsp[-4].TypeVal, Params, isVarArg, ActualAttrs);
+ delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list
+ delete yyvsp[-4].TypeVal; // Delete the return type handle
+ yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT));
CHECK_FOR_ERROR
;
break;}
-case 85:
-#line 1268 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 143:
+#line 1380 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ std::vector<const Type*> Params;
+ ParamAttrsVector Attrs;
+ if (yyvsp[0].ParamAttrs != ParamAttr::None) {
+ ParamAttrsWithIndex X; X.index = 0; X.attrs = yyvsp[0].ParamAttrs;
+ Attrs.push_back(X);
+ }
+ TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end();
+ unsigned index = 1;
+ for ( ; I != E; ++I, ++index) {
+ const Type* Ty = I->Ty->get();
+ Params.push_back(Ty);
+ if (Ty != Type::VoidTy)
+ if (I->Attrs != ParamAttr::None) {
+ ParamAttrsWithIndex X; X.index = index; X.attrs = I->Attrs;
+ Attrs.push_back(X);
+ }
+ }
+ bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
+ if (isVarArg) Params.pop_back();
+
+ ParamAttrsList *ActualAttrs = 0;
+ if (!Attrs.empty())
+ ActualAttrs = ParamAttrsList::get(Attrs);
+
+ FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg, ActualAttrs);
+ delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list
+ yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT));
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 144:
+#line 1411 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Sized array type?
yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val)));
delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 86:
-#line 1273 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Packed array type?
+case 145:
+#line 1416 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Vector type?
const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get();
if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val)
GEN_ERROR("Unsigned result not equal to signed result");
- if (!ElemTy->isPrimitiveType())
- GEN_ERROR("Elemental type of a PackedType must be primitive");
+ if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
+ GEN_ERROR("Element type of a VectorType must be primitive");
if (!isPowerOf2_32(yyvsp[-3].UInt64Val))
- GEN_ERROR("Vector length should be a power of 2!");
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(PackedType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val)));
+ GEN_ERROR("Vector length should be a power of 2");
+ yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val)));
delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 87:
-#line 1285 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 146:
+#line 1428 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Structure type?
std::vector<const Type*> Elements;
for (std::list<llvm::PATypeHolder>::iterator I = yyvsp[-1].TypeList->begin(),
CHECK_FOR_ERROR
;
break;}
-case 88:
-#line 1295 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 147:
+#line 1438 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Empty structure type?
yyval.TypeVal = new PATypeHolder(StructType::get(std::vector<const Type*>()));
CHECK_FOR_ERROR
;
break;}
-case 89:
-#line 1299 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Pointer type?
- if (*yyvsp[-1].TypeVal == Type::LabelTy)
- GEN_ERROR("Cannot form a pointer to a basic block");
- yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal)));
- delete yyvsp[-1].TypeVal;
+case 148:
+#line 1442 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ std::vector<const Type*> Elements;
+ for (std::list<llvm::PATypeHolder>::iterator I = yyvsp[-2].TypeList->begin(),
+ E = yyvsp[-2].TypeList->end(); I != E; ++I)
+ Elements.push_back(*I);
+
+ yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
+ delete yyvsp[-2].TypeList;
CHECK_FOR_ERROR
;
break;}
-case 90:
-#line 1310 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 149:
+#line 1452 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Empty structure type?
+ yyval.TypeVal = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 150:
+#line 1459 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal;
+ yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs;
+ ;
+ break;}
+case 151:
+#line 1466 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.TypeList = new std::list<PATypeHolder>();
- yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal;
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
+ if (!(*yyvsp[0].TypeVal)->isFirstClassType())
+ GEN_ERROR("LLVM functions cannot return aggregate types");
+ yyval.TypeVal = yyvsp[0].TypeVal;
+ ;
+ break;}
+case 152:
+#line 1473 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.TypeVal = new PATypeHolder(Type::VoidTy);
+ ;
+ break;}
+case 153:
+#line 1478 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.TypeWithAttrsList = new TypeWithAttrsList();
+ yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs);
CHECK_FOR_ERROR
;
break;}
-case 91:
-#line 1315 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 154:
+#line 1483 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal;
+ (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs);
CHECK_FOR_ERROR
;
break;}
-case 93:
-#line 1322 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 156:
+#line 1491 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- (yyval.TypeList=yyvsp[-2].TypeList)->push_back(Type::VoidTy);
+ yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList;
+ TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
+ TWA.Ty = new PATypeHolder(Type::VoidTy);
+ yyval.TypeWithAttrsList->push_back(TWA);
CHECK_FOR_ERROR
;
break;}
-case 94:
-#line 1326 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 157:
+#line 1498 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- (yyval.TypeList = new std::list<PATypeHolder>())->push_back(Type::VoidTy);
+ yyval.TypeWithAttrsList = new TypeWithAttrsList;
+ TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
+ TWA.Ty = new PATypeHolder(Type::VoidTy);
+ yyval.TypeWithAttrsList->push_back(TWA);
CHECK_FOR_ERROR
;
break;}
-case 95:
-#line 1330 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 158:
+#line 1505 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.TypeWithAttrsList = new TypeWithAttrsList();
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 159:
+#line 1513 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.TypeList = new std::list<PATypeHolder>();
+ yyval.TypeList->push_back(*yyvsp[0].TypeVal);
+ delete yyvsp[0].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 96:
-#line 1341 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 160:
+#line 1519 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal);
+ delete yyvsp[0].TypeVal;
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 161:
+#line 1531 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized arr
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
const ArrayType *ATy = dyn_cast<ArrayType>(yyvsp[-3].TypeVal->get());
if (ATy == 0)
GEN_ERROR("Cannot make array constant with type: '" +
- (*yyvsp[-3].TypeVal)->getDescription() + "'!");
+ (*yyvsp[-3].TypeVal)->getDescription() + "'");
const Type *ETy = ATy->getElementType();
int NumElements = ATy->getNumElements();
if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size())
GEN_ERROR("Type mismatch: constant sized array initialized with " +
utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " +
- itostr(NumElements) + "!");
+ itostr(NumElements) + "");
// Verify all elements are correct type!
for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) {
CHECK_FOR_ERROR
;
break;}
-case 97:
-#line 1367 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 162:
+#line 1559 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
const ArrayType *ATy = dyn_cast<ArrayType>(yyvsp[-2].TypeVal->get());
if (ATy == 0)
GEN_ERROR("Cannot make array constant with type: '" +
- (*yyvsp[-2].TypeVal)->getDescription() + "'!");
+ (*yyvsp[-2].TypeVal)->getDescription() + "'");
int NumElements = ATy->getNumElements();
if (NumElements != -1 && NumElements != 0)
GEN_ERROR("Type mismatch: constant sized array initialized with 0"
- " arguments, but has size of " + itostr(NumElements) +"!");
+ " arguments, but has size of " + itostr(NumElements) +"");
yyval.ConstVal = ConstantArray::get(ATy, std::vector<Constant*>());
delete yyvsp[-2].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 98:
-#line 1381 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 163:
+#line 1575 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
const ArrayType *ATy = dyn_cast<ArrayType>(yyvsp[-2].TypeVal->get());
if (ATy == 0)
GEN_ERROR("Cannot make array constant with type: '" +
- (*yyvsp[-2].TypeVal)->getDescription() + "'!");
+ (*yyvsp[-2].TypeVal)->getDescription() + "'");
int NumElements = ATy->getNumElements();
const Type *ETy = ATy->getElementType();
- char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true);
- if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal))
+ if (NumElements != -1 && NumElements != int(yyvsp[0].StrVal->length()))
GEN_ERROR("Can't build string constant of size " +
- itostr((int)(EndStr-yyvsp[0].StrVal)) +
- " when array has size " + itostr(NumElements) + "!");
+ itostr((int)(yyvsp[0].StrVal->length())) +
+ " when array has size " + itostr(NumElements) + "");
std::vector<Constant*> Vals;
- if (ETy == Type::SByteTy) {
- for (signed char *C = (signed char *)yyvsp[0].StrVal; C != (signed char *)EndStr; ++C)
- Vals.push_back(ConstantSInt::get(ETy, *C));
- } else if (ETy == Type::UByteTy) {
- for (unsigned char *C = (unsigned char *)yyvsp[0].StrVal;
- C != (unsigned char*)EndStr; ++C)
- Vals.push_back(ConstantUInt::get(ETy, *C));
+ if (ETy == Type::Int8Ty) {
+ for (unsigned i = 0; i < yyvsp[0].StrVal->length(); ++i)
+ Vals.push_back(ConstantInt::get(ETy, (*yyvsp[0].StrVal)[i]));
} else {
- free(yyvsp[0].StrVal);
- GEN_ERROR("Cannot build string arrays of non byte sized elements!");
+ delete yyvsp[0].StrVal;
+ GEN_ERROR("Cannot build string arrays of non byte sized elements");
}
- free(yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
yyval.ConstVal = ConstantArray::get(ATy, Vals);
delete yyvsp[-2].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 99:
-#line 1411 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 164:
+#line 1602 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized arr
- const PackedType *PTy = dyn_cast<PackedType>(yyvsp[-3].TypeVal->get());
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
+ const VectorType *PTy = dyn_cast<VectorType>(yyvsp[-3].TypeVal->get());
if (PTy == 0)
GEN_ERROR("Cannot make packed constant with type: '" +
- (*yyvsp[-3].TypeVal)->getDescription() + "'!");
+ (*yyvsp[-3].TypeVal)->getDescription() + "'");
const Type *ETy = PTy->getElementType();
int NumElements = PTy->getNumElements();
if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size())
GEN_ERROR("Type mismatch: constant sized packed initialized with " +
utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " +
- itostr(NumElements) + "!");
+ itostr(NumElements) + "");
// Verify all elements are correct type!
for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) {
(*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'.");
}
- yyval.ConstVal = ConstantPacked::get(PTy, *yyvsp[-1].ConstVector);
+ yyval.ConstVal = ConstantVector::get(PTy, *yyvsp[-1].ConstVector);
delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector;
CHECK_FOR_ERROR
;
break;}
-case 100:
-#line 1437 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 165:
+#line 1630 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
const StructType *STy = dyn_cast<StructType>(yyvsp[-3].TypeVal->get());
if (STy == 0)
GEN_ERROR("Cannot make struct constant with type: '" +
- (*yyvsp[-3].TypeVal)->getDescription() + "'!");
+ (*yyvsp[-3].TypeVal)->getDescription() + "'");
if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes())
- GEN_ERROR("Illegal number of initializers for structure type!");
+ GEN_ERROR("Illegal number of initializers for structure type");
// Check to ensure that constants are compatible with the type initializer!
for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i)
GEN_ERROR("Expected type '" +
STy->getElementType(i)->getDescription() +
"' for element #" + utostr(i) +
- " of structure initializer!");
+ " of structure initializer");
+
+ // Check to ensure that Type is not packed
+ if (STy->isPacked())
+ GEN_ERROR("Unpacked Initializer to vector type '" +
+ STy->getDescription() + "'");
yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector);
delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector;
CHECK_FOR_ERROR
;
break;}
-case 101:
-#line 1458 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 166:
+#line 1656 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
const StructType *STy = dyn_cast<StructType>(yyvsp[-2].TypeVal->get());
if (STy == 0)
GEN_ERROR("Cannot make struct constant with type: '" +
- (*yyvsp[-2].TypeVal)->getDescription() + "'!");
+ (*yyvsp[-2].TypeVal)->getDescription() + "'");
if (STy->getNumContainedTypes() != 0)
- GEN_ERROR("Illegal number of initializers for structure type!");
+ GEN_ERROR("Illegal number of initializers for structure type");
+
+ // Check to ensure that Type is not packed
+ if (STy->isPacked())
+ GEN_ERROR("Unpacked Initializer to vector type '" +
+ STy->getDescription() + "'");
yyval.ConstVal = ConstantStruct::get(STy, std::vector<Constant*>());
delete yyvsp[-2].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 102:
-#line 1471 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 167:
+#line 1676 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ const StructType *STy = dyn_cast<StructType>(yyvsp[-5].TypeVal->get());
+ if (STy == 0)
+ GEN_ERROR("Cannot make struct constant with type: '" +
+ (*yyvsp[-5].TypeVal)->getDescription() + "'");
+
+ if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes())
+ GEN_ERROR("Illegal number of initializers for structure type");
+
+ // Check to ensure that constants are compatible with the type initializer!
+ for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i)
+ if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i))
+ GEN_ERROR("Expected type '" +
+ STy->getElementType(i)->getDescription() +
+ "' for element #" + utostr(i) +
+ " of structure initializer");
+
+ // Check to ensure that Type is packed
+ if (!STy->isPacked())
+ GEN_ERROR("Vector initializer to non-vector type '" +
+ STy->getDescription() + "'");
+
+ yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector);
+ delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector;
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 168:
+#line 1702 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription());
+ const StructType *STy = dyn_cast<StructType>(yyvsp[-4].TypeVal->get());
+ if (STy == 0)
+ GEN_ERROR("Cannot make struct constant with type: '" +
+ (*yyvsp[-4].TypeVal)->getDescription() + "'");
+
+ if (STy->getNumContainedTypes() != 0)
+ GEN_ERROR("Illegal number of initializers for structure type");
+
+ // Check to ensure that Type is packed
+ if (!STy->isPacked())
+ GEN_ERROR("Vector initializer to non-vector type '" +
+ STy->getDescription() + "'");
+
+ yyval.ConstVal = ConstantStruct::get(STy, std::vector<Constant*>());
+ delete yyvsp[-4].TypeVal;
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 169:
+#line 1722 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
const PointerType *PTy = dyn_cast<PointerType>(yyvsp[-1].TypeVal->get());
if (PTy == 0)
GEN_ERROR("Cannot make null pointer constant with type: '" +
- (*yyvsp[-1].TypeVal)->getDescription() + "'!");
+ (*yyvsp[-1].TypeVal)->getDescription() + "'");
yyval.ConstVal = ConstantPointerNull::get(PTy);
delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 103:
-#line 1481 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 170:
+#line 1734 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get());
delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 104:
-#line 1486 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 171:
+#line 1741 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
const PointerType *Ty = dyn_cast<PointerType>(yyvsp[-1].TypeVal->get());
if (Ty == 0)
- GEN_ERROR("Global const reference must be a pointer type!");
+ GEN_ERROR("Global const reference must be a pointer type");
// ConstExprs can exist in the body of a function, thus creating
// GlobalValues whenever they refer to a variable. Because we are in
- // the context of a function, getValNonImprovising will search the functions
+ // the context of a function, getExistingVal will search the functions
// symbol table instead of the module symbol table for the global symbol,
// which throws things all off. To get around this, we just tell
- // getValNonImprovising that we are at global scope here.
+ // getExistingVal that we are at global scope here.
//
Function *SavedCurFn = CurFun.CurrentFunction;
CurFun.CurrentFunction = 0;
- Value *V = getValNonImprovising(Ty, yyvsp[0].ValIDVal);
+ Value *V = getExistingVal(Ty, yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
CurFun.CurrentFunction = SavedCurFn;
yyvsp[0].ValIDVal.destroy();
} else {
std::string Name;
- if (yyvsp[0].ValIDVal.Type == ValID::NameVal) Name = yyvsp[0].ValIDVal.Name;
+ if (yyvsp[0].ValIDVal.Type == ValID::GlobalName)
+ Name = yyvsp[0].ValIDVal.getName();
+ else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID)
+ GEN_ERROR("Invalid reference to global");
// Create the forward referenced global.
GlobalValue *GV;
if (const FunctionType *FTy =
dyn_cast<FunctionType>(PT->getElementType())) {
- GV = new Function(FTy, GlobalValue::ExternalLinkage, Name,
+ GV = new Function(FTy, GlobalValue::ExternalWeakLinkage, Name,
CurModule.CurrentModule);
} else {
GV = new GlobalVariable(PT->getElementType(), false,
- GlobalValue::ExternalLinkage, 0,
+ GlobalValue::ExternalWeakLinkage, 0,
Name, CurModule.CurrentModule);
}
CHECK_FOR_ERROR
;
break;}
-case 105:
-#line 1547 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 172:
+#line 1807 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType())
- GEN_ERROR("Mismatched types for constant expression!");
+ GEN_ERROR("Mismatched types for constant expression: " +
+ (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription());
yyval.ConstVal = yyvsp[0].ConstVal;
delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 106:
-#line 1554 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 173:
+#line 1817 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
const Type *Ty = yyvsp[-1].TypeVal->get();
if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
- GEN_ERROR("Cannot create a null initialized value of this type!");
+ GEN_ERROR("Cannot create a null initialized value of this type");
yyval.ConstVal = Constant::getNullValue(Ty);
delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 107:
-#line 1563 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 174:
+#line 1827 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // integral constants
- if (!ConstantSInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val))
- GEN_ERROR("Constant value doesn't fit in type!");
- yyval.ConstVal = ConstantSInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val);
+ if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val))
+ GEN_ERROR("Constant value doesn't fit in type");
+ yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val, true);
CHECK_FOR_ERROR
;
break;}
-case 108:
-#line 1569 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // integral constants
- if (!ConstantUInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val))
- GEN_ERROR("Constant value doesn't fit in type!");
- yyval.ConstVal = ConstantUInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val);
+case 175:
+#line 1833 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // arbitrary precision integer constants
+ uint32_t BitWidth = cast<IntegerType>(yyvsp[-1].PrimType)->getBitWidth();
+ if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) {
+ GEN_ERROR("Constant value does not fit in type");
+ }
+ yyvsp[0].APIntVal->sextOrTrunc(BitWidth);
+ yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal);
+ delete yyvsp[0].APIntVal;
CHECK_FOR_ERROR
;
break;}
-case 109:
-#line 1575 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 176:
+#line 1843 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // integral constants
+ if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val))
+ GEN_ERROR("Constant value doesn't fit in type");
+ yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val, false);
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 177:
+#line 1849 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // arbitrary precision integer constants
+ uint32_t BitWidth = cast<IntegerType>(yyvsp[-1].PrimType)->getBitWidth();
+ if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) {
+ GEN_ERROR("Constant value does not fit in type");
+ }
+ yyvsp[0].APIntVal->zextOrTrunc(BitWidth);
+ yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal);
+ delete yyvsp[0].APIntVal;
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 178:
+#line 1859 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Boolean constants
- yyval.ConstVal = ConstantBool::getTrue();
+ assert(cast<IntegerType>(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?");
+ yyval.ConstVal = ConstantInt::getTrue();
CHECK_FOR_ERROR
;
break;}
-case 110:
-#line 1579 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 179:
+#line 1864 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Boolean constants
- yyval.ConstVal = ConstantBool::getFalse();
+ assert(cast<IntegerType>(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?");
+ yyval.ConstVal = ConstantInt::getFalse();
CHECK_FOR_ERROR
;
break;}
-case 111:
-#line 1583 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Float & Double constants
- if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal))
- GEN_ERROR("Floating point constant invalid for type!!");
- yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal);
+case 180:
+#line 1869 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Floating point constants
+ if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, *yyvsp[0].FPVal))
+ GEN_ERROR("Floating point constant invalid for type");
+ // Lexer has no type info, so builds all float and double FP constants
+ // as double. Fix this here. Long double is done right.
+ if (&yyvsp[0].FPVal->getSemantics()==&APFloat::IEEEdouble && yyvsp[-1].PrimType==Type::FloatTy)
+ yyvsp[0].FPVal->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
+ yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, *yyvsp[0].FPVal);
+ delete yyvsp[0].FPVal;
CHECK_FOR_ERROR
;
break;}
-case 112:
-#line 1591 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (!yyvsp[-3].ConstVal->getType()->isFirstClassType())
- GEN_ERROR("cast constant expression from a non-primitive type: '" +
- yyvsp[-3].ConstVal->getType()->getDescription() + "'!");
- if (!yyvsp[-1].TypeVal->get()->isFirstClassType())
- GEN_ERROR("cast constant expression to a non-primitive type: '" +
- yyvsp[-1].TypeVal->get()->getDescription() + "'!");
- yyval.ConstVal = ConstantExpr::getCast(yyvsp[-3].ConstVal, yyvsp[-1].TypeVal->get());
+case 181:
+#line 1882 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
+ Constant *Val = yyvsp[-3].ConstVal;
+ const Type *DestTy = yyvsp[-1].TypeVal->get();
+ if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy))
+ GEN_ERROR("invalid cast opcode for cast from '" +
+ Val->getType()->getDescription() + "' to '" +
+ DestTy->getDescription() + "'");
+ yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy);
delete yyvsp[-1].TypeVal;
- CHECK_FOR_ERROR
;
break;}
-case 113:
-#line 1602 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 182:
+#line 1894 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa<PointerType>(yyvsp[-2].ConstVal->getType()))
- GEN_ERROR("GetElementPtr requires a pointer operand!");
-
- // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct
- // indices to uint struct indices for compatibility.
- generic_gep_type_iterator<std::vector<Value*>::iterator>
- GTI = gep_type_begin(yyvsp[-2].ConstVal->getType(), yyvsp[-1].ValueList->begin(), yyvsp[-1].ValueList->end()),
- GTE = gep_type_end(yyvsp[-2].ConstVal->getType(), yyvsp[-1].ValueList->begin(), yyvsp[-1].ValueList->end());
- for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e && GTI != GTE; ++i, ++GTI)
- if (isa<StructType>(*GTI)) // Only change struct indices
- if (ConstantUInt *CUI = dyn_cast<ConstantUInt>((*yyvsp[-1].ValueList)[i]))
- if (CUI->getType() == Type::UByteTy)
- (*yyvsp[-1].ValueList)[i] = ConstantExpr::getCast(CUI, Type::UIntTy);
+ GEN_ERROR("GetElementPtr requires a pointer operand");
const Type *IdxTy =
- GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), *yyvsp[-1].ValueList, true);
+ GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), yyvsp[-1].ValueList->begin(), yyvsp[-1].ValueList->end(),
+ true);
if (!IdxTy)
- GEN_ERROR("Index list invalid for constant getelementptr!");
+ GEN_ERROR("Index list invalid for constant getelementptr");
- std::vector<Constant*> IdxVec;
+ SmallVector<Constant*, 8> IdxVec;
for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i)
if (Constant *C = dyn_cast<Constant>((*yyvsp[-1].ValueList)[i]))
IdxVec.push_back(C);
else
- GEN_ERROR("Indices to constant getelementptr must be constants!");
+ GEN_ERROR("Indices to constant getelementptr must be constants");
delete yyvsp[-1].ValueList;
- yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, IdxVec);
+ yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size());
CHECK_FOR_ERROR
;
break;}
-case 114:
-#line 1634 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 183:
+#line 1916 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if (yyvsp[-5].ConstVal->getType() != Type::BoolTy)
- GEN_ERROR("Select condition must be of boolean type!");
+ if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty)
+ GEN_ERROR("Select condition must be of boolean type");
if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
- GEN_ERROR("Select operand types must match!");
+ GEN_ERROR("Select operand types must match");
yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
CHECK_FOR_ERROR
;
break;}
-case 115:
-#line 1642 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 184:
+#line 1924 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
- GEN_ERROR("Binary operator types must match!");
- // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs.
- // To retain backward compatibility with these early compilers, we emit a
- // cast to the appropriate integer type automatically if we are in the
- // broken case. See PR424 for more information.
- if (!isa<PointerType>(yyvsp[-3].ConstVal->getType())) {
- yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
- } else {
- const Type *IntPtrTy = 0;
- switch (CurModule.CurrentModule->getPointerSize()) {
- case Module::Pointer32: IntPtrTy = Type::IntTy; break;
- case Module::Pointer64: IntPtrTy = Type::LongTy; break;
- default: GEN_ERROR("invalid pointer binary constant expr!");
- }
- yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, ConstantExpr::getCast(yyvsp[-3].ConstVal, IntPtrTy),
- ConstantExpr::getCast(yyvsp[-1].ConstVal, IntPtrTy));
- yyval.ConstVal = ConstantExpr::getCast(yyval.ConstVal, yyvsp[-3].ConstVal->getType());
- }
- CHECK_FOR_ERROR
+ GEN_ERROR("Binary operator types must match");
+ CHECK_FOR_ERROR;
+ yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
;
break;}
-case 116:
-#line 1664 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 185:
+#line 1930 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
- GEN_ERROR("Logical operator types must match!");
- if (!yyvsp[-3].ConstVal->getType()->isIntegral()) {
- if (!isa<PackedType>(yyvsp[-3].ConstVal->getType()) ||
- !cast<PackedType>(yyvsp[-3].ConstVal->getType())->getElementType()->isIntegral())
- GEN_ERROR("Logical operator requires integral operands!");
+ GEN_ERROR("Logical operator types must match");
+ if (!yyvsp[-3].ConstVal->getType()->isInteger()) {
+ if (Instruction::isShift(yyvsp[-5].BinaryOpVal) || !isa<VectorType>(yyvsp[-3].ConstVal->getType()) ||
+ !cast<VectorType>(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger())
+ GEN_ERROR("Logical operator requires integral operands");
}
yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
CHECK_FOR_ERROR
;
break;}
-case 117:
-#line 1675 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 186:
+#line 1941 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
- GEN_ERROR("setcc operand types must match!");
- yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
- CHECK_FOR_ERROR
+ GEN_ERROR("icmp operand types must match");
+ yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
;
break;}
-case 118:
-#line 1681 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 187:
+#line 1946 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if (yyvsp[-1].ConstVal->getType() != Type::UByteTy)
- GEN_ERROR("Shift count for shift constant must be unsigned byte!");
- if (!yyvsp[-3].ConstVal->getType()->isInteger())
- GEN_ERROR("Shift constant expression requires integer operand!");
- yyval.ConstVal = ConstantExpr::get(yyvsp[-5].OtherOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
- CHECK_FOR_ERROR
+ if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
+ GEN_ERROR("fcmp operand types must match");
+ yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
;
break;}
-case 119:
-#line 1689 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 188:
+#line 1951 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal))
- GEN_ERROR("Invalid extractelement operands!");
+ GEN_ERROR("Invalid extractelement operands");
yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
CHECK_FOR_ERROR
;
break;}
-case 120:
-#line 1695 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 189:
+#line 1957 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal))
- GEN_ERROR("Invalid insertelement operands!");
+ GEN_ERROR("Invalid insertelement operands");
yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
CHECK_FOR_ERROR
;
break;}
-case 121:
-#line 1701 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 190:
+#line 1963 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal))
- GEN_ERROR("Invalid shufflevector operands!");
+ GEN_ERROR("Invalid shufflevector operands");
yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
CHECK_FOR_ERROR
;
break;}
-case 122:
-#line 1710 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 191:
+#line 1972 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal);
CHECK_FOR_ERROR
;
break;}
-case 123:
-#line 1714 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 192:
+#line 1976 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.ConstVector = new std::vector<Constant*>();
yyval.ConstVector->push_back(yyvsp[0].ConstVal);
CHECK_FOR_ERROR
;
break;}
-case 124:
-#line 1722 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 193:
+#line 1984 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ yyval.BoolVal = false; ;
break;}
-case 125:
-#line 1722 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 194:
+#line 1984 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ yyval.BoolVal = true; ;
break;}
-case 126:
-#line 1732 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ModuleVal = ParserResult = yyvsp[0].ModuleVal;
- CurModule.ModuleDone();
- CHECK_FOR_ERROR;
-;
+case 195:
+#line 1987 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.BoolVal = true; ;
break;}
-case 127:
-#line 1740 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 196:
+#line 1987 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.BoolVal = false; ;
+ break;}
+case 197:
+#line 1990 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ModuleVal = yyvsp[-1].ModuleVal;
- CurFun.FunctionDone();
+ const Type* VTy = yyvsp[-1].TypeVal->get();
+ Value *V = getVal(VTy, yyvsp[0].ValIDVal);
+ CHECK_FOR_ERROR
+ GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
+ if (!Aliasee)
+ GEN_ERROR("Aliases can be created only to global values");
+
+ yyval.ConstVal = Aliasee;
+ CHECK_FOR_ERROR
+ delete yyvsp[-1].TypeVal;
+ ;
+ break;}
+case 198:
+#line 2002 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ Constant *Val = yyvsp[-3].ConstVal;
+ const Type *DestTy = yyvsp[-1].TypeVal->get();
+ if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy))
+ GEN_ERROR("invalid cast opcode for cast from '" +
+ Val->getType()->getDescription() + "' to '" +
+ DestTy->getDescription() + "'");
+
+ yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy);
CHECK_FOR_ERROR
+ delete yyvsp[-1].TypeVal;
+ ;
+ break;}
+case 199:
+#line 2023 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.ModuleVal = ParserResult = CurModule.CurrentModule;
+ CurModule.ModuleDone();
+ CHECK_FOR_ERROR;
;
break;}
-case 128:
-#line 1745 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 200:
+#line 2028 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ModuleVal = yyvsp[-1].ModuleVal;
- CHECK_FOR_ERROR
+ yyval.ModuleVal = ParserResult = CurModule.CurrentModule;
+ CurModule.ModuleDone();
+ CHECK_FOR_ERROR;
;
break;}
-case 129:
-#line 1749 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 203:
+#line 2041 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ CurFun.isDeclare = false; ;
+ break;}
+case 204:
+#line 2041 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ModuleVal = yyvsp[-3].ModuleVal;
+ CurFun.FunctionDone();
CHECK_FOR_ERROR
;
break;}
-case 130:
-#line 1753 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 205:
+#line 2045 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ CurFun.isDeclare = true; ;
+ break;}
+case 206:
+#line 2045 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ModuleVal = yyvsp[-1].ModuleVal;
CHECK_FOR_ERROR
;
break;}
-case 131:
-#line 1757 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 207:
+#line 2048 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ModuleVal = CurModule.CurrentModule;
- // Emit an error if there are any unresolved types left.
- if (!CurModule.LateResolveTypes.empty()) {
- const ValID &DID = CurModule.LateResolveTypes.begin()->first;
- if (DID.Type == ValID::NameVal) {
- GEN_ERROR("Reference to an undefined type: '"+DID.getName() + "'");
- } else {
- GEN_ERROR("Reference to an undefined type: #" + itostr(DID.Num));
- }
- }
CHECK_FOR_ERROR
;
break;}
-case 132:
-#line 1772 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 208:
+#line 2051 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
// Eagerly resolve types. This is not an optimization, this is a
// requirement that is due to the fact that we could have this:
//
CHECK_FOR_ERROR
;
break;}
-case 133:
-#line 1794 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Function prototypes can be in const pool
- CHECK_FOR_ERROR
- ;
- break;}
-case 134:
-#line 1797 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Asm blocks can be in the const pool
+case 209:
+#line 2075 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType);
+
+ if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) {
+ CHECK_FOR_ERROR
+ // If this is a named type that is not a redefinition, add it to the slot
+ // table.
+ CurModule.Types.push_back(yyvsp[0].PrimType);
+ }
CHECK_FOR_ERROR
;
break;}
-case 135:
-#line 1800 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
+case 210:
+#line 2086 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ /* "Externally Visible" Linkage */
if (yyvsp[0].ConstVal == 0)
- GEN_ERROR("Global value initializer is not a constant!");
- CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, yyvsp[-2].Linkage, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal);
+ GEN_ERROR("Global value initializer is not a constant");
+ CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, GlobalValue::ExternalLinkage,
+ yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal);
CHECK_FOR_ERROR
;
break;}
-case 136:
-#line 1805 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 211:
+#line 2093 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
;
break;}
-case 137:
-#line 1808 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 212:
+#line 2097 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0);
+ if (yyvsp[0].ConstVal == 0)
+ GEN_ERROR("Global value initializer is not a constant");
+ CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal);
CHECK_FOR_ERROR
- delete yyvsp[0].TypeVal;
;
break;}
-case 138:
-#line 1812 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 213:
+#line 2102 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
- CHECK_FOR_ERROR
;
break;}
-case 139:
-#line 1816 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 214:
+#line 2106 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::DLLImportLinkage, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0);
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
+ CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0, yyvsp[-2].BoolVal);
CHECK_FOR_ERROR
delete yyvsp[0].TypeVal;
;
break;}
-case 140:
-#line 1820 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 215:
+#line 2112 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
CHECK_FOR_ERROR
;
break;}
-case 141:
-#line 1824 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CurGV =
- ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalWeakLinkage, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0);
- CHECK_FOR_ERROR
- delete yyvsp[0].TypeVal;
- ;
- break;}
-case 142:
-#line 1829 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 216:
+#line 2116 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- CurGV = 0;
+ std::string Name;
+ if (yyvsp[-4].StrVal) {
+ Name = *yyvsp[-4].StrVal;
+ delete yyvsp[-4].StrVal;
+ }
+ if (Name.empty())
+ GEN_ERROR("Alias name cannot be empty");
+
+ Constant* Aliasee = yyvsp[0].ConstVal;
+ if (Aliasee == 0)
+ GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
+
+ GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), yyvsp[-1].Linkage, Name, Aliasee,
+ CurModule.CurrentModule);
+ GA->setVisibility(yyvsp[-3].Visibility);
+ InsertValue(GA, CurModule.Values);
+
+
+ // If there was a forward reference of this alias, resolve it now.
+
+ ValID ID;
+ if (!Name.empty())
+ ID = ValID::createGlobalName(Name);
+ else
+ ID = ValID::createGlobalID(CurModule.Values.size()-1);
+
+ if (GlobalValue *FWGV =
+ CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
+ // Replace uses of the fwdref with the actual alias.
+ FWGV->replaceAllUsesWith(GA);
+ if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
+ GV->eraseFromParent();
+ else
+ cast<Function>(FWGV)->eraseFromParent();
+ }
+ ID.destroy();
+
CHECK_FOR_ERROR
;
break;}
-case 143:
-#line 1833 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 217:
+#line 2156 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;
break;}
-case 144:
-#line 1836 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 218:
+#line 2159 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;
break;}
-case 145:
-#line 1839 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- ;
- break;}
-case 146:
-#line 1843 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 219:
+#line 2165 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
- char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true);
- std::string NewAsm(yyvsp[0].StrVal, EndStr);
- free(yyvsp[0].StrVal);
-
if (AsmSoFar.empty())
- CurModule.CurrentModule->setModuleInlineAsm(NewAsm);
+ CurModule.CurrentModule->setModuleInlineAsm(*yyvsp[0].StrVal);
else
- CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm);
+ CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
CHECK_FOR_ERROR
;
break;}
-case 147:
-#line 1856 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Endianness = Module::BigEndian; ;
- break;}
-case 148:
-#line 1857 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.Endianness = Module::LittleEndian; ;
- break;}
-case 149:
-#line 1859 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- CurModule.CurrentModule->setEndianness(yyvsp[0].Endianness);
- CHECK_FOR_ERROR
- ;
- break;}
-case 150:
-#line 1863 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[0].UInt64Val == 32)
- CurModule.CurrentModule->setPointerSize(Module::Pointer32);
- else if (yyvsp[0].UInt64Val == 64)
- CurModule.CurrentModule->setPointerSize(Module::Pointer64);
- else
- GEN_ERROR("Invalid pointer size: '" + utostr(yyvsp[0].UInt64Val) + "'!");
- CHECK_FOR_ERROR
- ;
- break;}
-case 151:
-#line 1872 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 220:
+#line 2175 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal);
- free(yyvsp[0].StrVal);
- CHECK_FOR_ERROR
+ CurModule.CurrentModule->setTargetTriple(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
;
break;}
-case 152:
-#line 1877 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 221:
+#line 2179 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal);
- free(yyvsp[0].StrVal);
- CHECK_FOR_ERROR
+ CurModule.CurrentModule->setDataLayout(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
;
break;}
-case 154:
-#line 1885 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 223:
+#line 2186 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal);
- free(yyvsp[0].StrVal);
+ CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
CHECK_FOR_ERROR
;
break;}
-case 155:
-#line 1890 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 224:
+#line 2191 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal);
- free(yyvsp[0].StrVal);
+ CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
CHECK_FOR_ERROR
;
break;}
-case 156:
-#line 1895 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 225:
+#line 2196 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;
break;}
-case 160:
-#line 1905 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.StrVal = 0; ;
- break;}
-case 161:
-#line 1907 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (*yyvsp[-1].TypeVal == Type::VoidTy)
- GEN_ERROR("void typed arguments are invalid!");
- yyval.ArgVal = new std::pair<PATypeHolder*, char*>(yyvsp[-1].TypeVal, yyvsp[0].StrVal);
- CHECK_FOR_ERROR
-;
- break;}
-case 162:
-#line 1914 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 226:
+#line 2205 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ArgList = yyvsp[-2].ArgList;
- yyvsp[-2].ArgList->push_back(*yyvsp[0].ArgVal);
- delete yyvsp[0].ArgVal;
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
+ if (*yyvsp[-2].TypeVal == Type::VoidTy)
+ GEN_ERROR("void typed arguments are invalid");
+ ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal;
+ yyval.ArgList = yyvsp[-4].ArgList;
+ yyvsp[-4].ArgList->push_back(E);
CHECK_FOR_ERROR
;
break;}
-case 163:
-#line 1920 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 227:
+#line 2215 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ArgList = new std::vector<std::pair<PATypeHolder*,char*> >();
- yyval.ArgList->push_back(*yyvsp[0].ArgVal);
- delete yyvsp[0].ArgVal;
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
+ if (*yyvsp[-2].TypeVal == Type::VoidTy)
+ GEN_ERROR("void typed arguments are invalid");
+ ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal;
+ yyval.ArgList = new ArgListType;
+ yyval.ArgList->push_back(E);
CHECK_FOR_ERROR
;
break;}
-case 164:
-#line 1927 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 228:
+#line 2226 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.ArgList = yyvsp[0].ArgList;
CHECK_FOR_ERROR
;
break;}
-case 165:
-#line 1931 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 229:
+#line 2230 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.ArgList = yyvsp[-2].ArgList;
- yyval.ArgList->push_back(std::pair<PATypeHolder*,
- char*>(new PATypeHolder(Type::VoidTy), 0));
+ struct ArgListEntry E;
+ E.Ty = new PATypeHolder(Type::VoidTy);
+ E.Name = 0;
+ E.Attrs = ParamAttr::None;
+ yyval.ArgList->push_back(E);
CHECK_FOR_ERROR
;
break;}
-case 166:
-#line 1937 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 230:
+#line 2239 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ArgList = new std::vector<std::pair<PATypeHolder*,char*> >();
- yyval.ArgList->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0));
+ yyval.ArgList = new ArgListType;
+ struct ArgListEntry E;
+ E.Ty = new PATypeHolder(Type::VoidTy);
+ E.Name = 0;
+ E.Attrs = ParamAttr::None;
+ yyval.ArgList->push_back(E);
CHECK_FOR_ERROR
;
break;}
-case 167:
-#line 1942 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 231:
+#line 2248 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.ArgList = 0;
CHECK_FOR_ERROR
;
break;}
-case 168:
-#line 1948 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 232:
+#line 2254 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- UnEscapeLexed(yyvsp[-5].StrVal);
- std::string FunctionName(yyvsp[-5].StrVal);
- free(yyvsp[-5].StrVal); // Free strdup'd memory!
+ std::string FunctionName(*yyvsp[-6].StrVal);
+ delete yyvsp[-6].StrVal; // Free strdup'd memory!
- if (!(*yyvsp[-6].TypeVal)->isFirstClassType() && *yyvsp[-6].TypeVal != Type::VoidTy)
- GEN_ERROR("LLVM functions cannot return aggregate types!");
+ // Check the function result for abstractness if this is a define. We should
+ // have no abstract types at this point
+ if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-7].TypeVal))
+ GEN_ERROR("Reference to abstract result: "+ yyvsp[-7].TypeVal->get()->getDescription());
std::vector<const Type*> ParamTypeList;
- if (yyvsp[-3].ArgList) { // If there are arguments...
- for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = yyvsp[-3].ArgList->begin();
- I != yyvsp[-3].ArgList->end(); ++I)
- ParamTypeList.push_back(I->first->get());
+ ParamAttrsVector Attrs;
+ if (yyvsp[-2].ParamAttrs != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-2].ParamAttrs;
+ Attrs.push_back(PAWI);
+ }
+ if (yyvsp[-4].ArgList) { // If there are arguments...
+ unsigned index = 1;
+ for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); I != yyvsp[-4].ArgList->end(); ++I, ++index) {
+ const Type* Ty = I->Ty->get();
+ if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
+ GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
+ ParamTypeList.push_back(Ty);
+ if (Ty != Type::VoidTy)
+ if (I->Attrs != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = index; PAWI.attrs = I->Attrs;
+ Attrs.push_back(PAWI);
+ }
+ }
}
bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
if (isVarArg) ParamTypeList.pop_back();
- const FunctionType *FT = FunctionType::get(*yyvsp[-6].TypeVal, ParamTypeList, isVarArg);
+ ParamAttrsList *PAL = 0;
+ if (!Attrs.empty())
+ PAL = ParamAttrsList::get(Attrs);
+
+ FunctionType *FT = FunctionType::get(*yyvsp[-7].TypeVal, ParamTypeList, isVarArg, PAL);
const PointerType *PFT = PointerType::get(FT);
- delete yyvsp[-6].TypeVal;
+ delete yyvsp[-7].TypeVal;
ValID ID;
if (!FunctionName.empty()) {
- ID = ValID::create((char*)FunctionName.c_str());
+ ID = ValID::createGlobalName((char*)FunctionName.c_str());
} else {
- ID = ValID::create((int)CurModule.Values[PFT].size());
+ ID = ValID::createGlobalID(CurModule.Values.size());
}
Function *Fn = 0;
CurModule.CurrentModule->getFunctionList().remove(Fn);
CurModule.CurrentModule->getFunctionList().push_back(Fn);
} else if (!FunctionName.empty() && // Merge with an earlier prototype?
- (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) {
- // If this is the case, either we need to be a forward decl, or it needs
- // to be.
- if (!CurFun.isDeclare && !Fn->isExternal())
- GEN_ERROR("Redefinition of function '" + FunctionName + "'!");
-
- // Make sure to strip off any argument names so we can't get conflicts.
- if (Fn->isExternal())
+ (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
+ if (Fn->getFunctionType() != FT) {
+ // The existing function doesn't have the same type. This is an overload
+ // 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 + "'");
+ } 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();
AI != AE; ++AI)
AI->setName("");
+ }
} else { // Not already defined?
- Fn = new Function(FT, GlobalValue::ExternalLinkage, FunctionName,
+ Fn = new Function(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
CurModule.CurrentModule);
InsertValue(Fn, CurModule.Values);
// correctly handle cases, when pointer to function is passed as argument to
// another function.
Fn->setLinkage(CurFun.Linkage);
+ Fn->setVisibility(CurFun.Visibility);
}
- Fn->setCallingConv(yyvsp[-7].UIntVal);
+ Fn->setCallingConv(yyvsp[-8].UIntVal);
Fn->setAlignment(yyvsp[0].UIntVal);
if (yyvsp[-1].StrVal) {
- Fn->setSection(yyvsp[-1].StrVal);
- free(yyvsp[-1].StrVal);
+ Fn->setSection(*yyvsp[-1].StrVal);
+ delete yyvsp[-1].StrVal;
}
// Add all of the arguments we parsed to the function...
- if (yyvsp[-3].ArgList) { // Is null if empty...
+ if (yyvsp[-4].ArgList) { // Is null if empty...
if (isVarArg) { // Nuke the last entry
- assert(yyvsp[-3].ArgList->back().first->get() == Type::VoidTy && yyvsp[-3].ArgList->back().second == 0&&
+ assert(yyvsp[-4].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-4].ArgList->back().Name == 0 &&
"Not a varargs marker!");
- delete yyvsp[-3].ArgList->back().first;
- yyvsp[-3].ArgList->pop_back(); // Delete the last entry
+ delete yyvsp[-4].ArgList->back().Ty;
+ yyvsp[-4].ArgList->pop_back(); // Delete the last entry
}
Function::arg_iterator ArgIt = Fn->arg_begin();
- for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = yyvsp[-3].ArgList->begin();
- I != yyvsp[-3].ArgList->end(); ++I, ++ArgIt) {
- delete I->first; // Delete the typeholder...
-
- setValueName(ArgIt, I->second); // Insert arg into symtab...
+ Function::arg_iterator ArgEnd = Fn->arg_end();
+ unsigned Idx = 1;
+ for (ArgListType::iterator I = yyvsp[-4].ArgList->begin();
+ I != yyvsp[-4].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
+ delete I->Ty; // Delete the typeholder...
+ setValueName(ArgIt, I->Name); // Insert arg into symtab...
CHECK_FOR_ERROR
InsertValue(ArgIt);
+ Idx++;
}
- delete yyvsp[-3].ArgList; // We're now done with the argument list
+ delete yyvsp[-4].ArgList; // We're now done with the argument list
}
CHECK_FOR_ERROR
;
break;}
-case 171:
-#line 2044 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 235:
+#line 2376 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.FunctionVal = CurFun.CurrentFunction;
// Make sure that we keep track of the linkage type even if there was a
// previous "declare".
- yyval.FunctionVal->setLinkage(yyvsp[-2].Linkage);
+ yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage);
+ yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility);
;
break;}
-case 174:
-#line 2054 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 238:
+#line 2387 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.FunctionVal = yyvsp[-1].FunctionVal;
CHECK_FOR_ERROR
;
break;}
-case 176:
-#line 2060 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ CurFun.Linkage = GlobalValue::DLLImportLinkage ;
- break;}
-case 177:
-#line 2061 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ CurFun.Linkage = GlobalValue::DLLImportLinkage ;
- break;}
-case 178:
-#line 2063 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ CurFun.isDeclare = true; ;
- break;}
-case 179:
-#line 2063 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 239:
+#line 2392 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage);
+ CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility);
yyval.FunctionVal = CurFun.CurrentFunction;
CurFun.FunctionDone();
CHECK_FOR_ERROR
;
break;}
-case 180:
-#line 2073 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 240:
+#line 2404 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.BoolVal = false;
CHECK_FOR_ERROR
;
break;}
-case 181:
-#line 2077 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 241:
+#line 2408 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.BoolVal = true;
CHECK_FOR_ERROR
;
break;}
-case 182:
-#line 2082 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 242:
+#line 2413 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // A reference to a direct constant
yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val);
CHECK_FOR_ERROR
;
break;}
-case 183:
-#line 2086 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 243:
+#line 2417 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val);
CHECK_FOR_ERROR
;
break;}
-case 184:
-#line 2090 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 244:
+#line 2421 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Perhaps it's an FP constant?
yyval.ValIDVal = ValID::create(yyvsp[0].FPVal);
CHECK_FOR_ERROR
;
break;}
-case 185:
-#line 2094 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 245:
+#line 2425 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ValIDVal = ValID::create(ConstantBool::getTrue());
+ yyval.ValIDVal = ValID::create(ConstantInt::getTrue());
CHECK_FOR_ERROR
;
break;}
-case 186:
-#line 2098 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 246:
+#line 2429 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ValIDVal = ValID::create(ConstantBool::getFalse());
+ yyval.ValIDVal = ValID::create(ConstantInt::getFalse());
CHECK_FOR_ERROR
;
break;}
-case 187:
-#line 2102 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 247:
+#line 2433 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.ValIDVal = ValID::createNull();
CHECK_FOR_ERROR
;
break;}
-case 188:
-#line 2106 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 248:
+#line 2437 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.ValIDVal = ValID::createUndef();
CHECK_FOR_ERROR
;
break;}
-case 189:
-#line 2110 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 249:
+#line 2441 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // A vector zero constant.
yyval.ValIDVal = ValID::createZeroInit();
CHECK_FOR_ERROR
;
break;}
-case 190:
-#line 2114 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 250:
+#line 2445 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized packed vector
const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType();
int NumElements = yyvsp[-1].ConstVector->size();
- PackedType* pt = PackedType::get(ETy, NumElements);
+ VectorType* pt = VectorType::get(ETy, NumElements);
PATypeHolder* PTy = new PATypeHolder(
HandleUpRefs(
- PackedType::get(
+ VectorType::get(
ETy,
NumElements)
)
(*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'.");
}
- yyval.ValIDVal = ValID::create(ConstantPacked::get(pt, *yyvsp[-1].ConstVector));
+ yyval.ValIDVal = ValID::create(ConstantVector::get(pt, *yyvsp[-1].ConstVector));
delete PTy; delete yyvsp[-1].ConstVector;
CHECK_FOR_ERROR
;
break;}
-case 191:
-#line 2139 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 251:
+#line 2470 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal);
CHECK_FOR_ERROR
;
break;}
-case 192:
-#line 2143 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 252:
+#line 2474 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- char *End = UnEscapeLexed(yyvsp[-2].StrVal, true);
- std::string AsmStr = std::string(yyvsp[-2].StrVal, End);
- End = UnEscapeLexed(yyvsp[0].StrVal, true);
- std::string Constraints = std::string(yyvsp[0].StrVal, End);
- yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal);
- free(yyvsp[-2].StrVal);
- free(yyvsp[0].StrVal);
+ yyval.ValIDVal = ValID::createInlineAsm(*yyvsp[-2].StrVal, *yyvsp[0].StrVal, yyvsp[-3].BoolVal);
+ delete yyvsp[-2].StrVal;
+ delete yyvsp[0].StrVal;
CHECK_FOR_ERROR
;
break;}
-case 193:
-#line 2157 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 253:
+#line 2484 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it an integer reference...?
- yyval.ValIDVal = ValID::create(yyvsp[0].SIntVal);
+ yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal);
CHECK_FOR_ERROR
;
break;}
-case 194:
-#line 2161 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 254:
+#line 2488 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal);
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 255:
+#line 2492 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it a named reference...?
- yyval.ValIDVal = ValID::create(yyvsp[0].StrVal);
+ yyval.ValIDVal = ValID::createLocalName(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
CHECK_FOR_ERROR
;
break;}
-case 197:
-#line 2173 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 256:
+#line 2497 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Is it a named reference...?
+ yyval.ValIDVal = ValID::createGlobalName(*yyvsp[0].StrVal);
+ delete yyvsp[0].StrVal;
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 259:
+#line 2510 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); delete yyvsp[-1].TypeVal;
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
+ yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal);
+ delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 198:
-#line 2178 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 260:
+#line 2519 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.FunctionVal = yyvsp[-1].FunctionVal;
CHECK_FOR_ERROR
;
break;}
-case 199:
-#line 2182 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 261:
+#line 2523 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Do not allow functions with 0 basic blocks
yyval.FunctionVal = yyvsp[-1].FunctionVal;
CHECK_FOR_ERROR
;
break;}
-case 200:
-#line 2191 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 262:
+#line 2532 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal);
CHECK_FOR_ERROR
InsertValue(yyvsp[0].TermInstVal);
-
yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal);
- InsertValue(yyvsp[-2].BasicBlockVal);
yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal;
CHECK_FOR_ERROR
;
break;}
-case 201:
-#line 2202 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 263:
+#line 2541 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (CastInst *CI1 = dyn_cast<CastInst>(yyvsp[0].InstVal))
+ if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
+ if (CI2->getParent() == 0)
+ yyvsp[-1].BasicBlockVal->getInstList().push_back(CI2);
yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal);
yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal;
CHECK_FOR_ERROR
;
break;}
-case 202:
-#line 2207 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.BasicBlockVal = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true);
- CHECK_FOR_ERROR
-
- // Make sure to move the basic block to the correct location in the
- // function, instead of leaving it inserted wherever it was first
- // referenced.
- Function::BasicBlockListType &BBL =
- CurFun.CurrentFunction->getBasicBlockList();
- BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal);
+case 264:
+#line 2550 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Empty space between instruction lists
+ yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
CHECK_FOR_ERROR
;
break;}
-case 203:
-#line 2219 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.BasicBlockVal = CurBB = getBBVal(ValID::create(yyvsp[0].StrVal), true);
+case 265:
+#line 2554 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Labelled (named) basic block
+ yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(*yyvsp[0].StrVal));
+ delete yyvsp[0].StrVal;
CHECK_FOR_ERROR
- // Make sure to move the basic block to the correct location in the
- // function, instead of leaving it inserted wherever it was first
- // referenced.
- Function::BasicBlockListType &BBL =
- CurFun.CurrentFunction->getBasicBlockList();
- BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal);
- CHECK_FOR_ERROR
;
break;}
-case 204:
-#line 2232 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 266:
+#line 2561 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Return with a result...
yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal);
CHECK_FOR_ERROR
;
break;}
-case 205:
-#line 2236 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Return with no result...
+case 267:
+#line 2565 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Return with no result...
yyval.TermInstVal = new ReturnInst();
CHECK_FOR_ERROR
;
break;}
-case 206:
-#line 2240 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Unconditional Branch...
+case 268:
+#line 2569 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ // Unconditional Branch...
BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
yyval.TermInstVal = new BranchInst(tmpBB);
;
break;}
-case 207:
-#line 2245 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 269:
+#line 2574 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ assert(cast<IntegerType>(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?");
BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal);
CHECK_FOR_ERROR
BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
- Value* tmpVal = getVal(Type::BoolTy, yyvsp[-6].ValIDVal);
+ Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal);
CHECK_FOR_ERROR
yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal);
;
break;}
-case 208:
-#line 2254 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 270:
+#line 2584 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal);
CHECK_FOR_ERROR
if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
S->addCase(CI, I->second);
else
- GEN_ERROR("Switch case is constant, but not a simple integer!");
+ GEN_ERROR("Switch case is constant, but not a simple integer");
}
delete yyvsp[-1].JumpTable;
CHECK_FOR_ERROR
;
break;}
-case 209:
-#line 2273 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 271:
+#line 2603 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal);
CHECK_FOR_ERROR
CHECK_FOR_ERROR
;
break;}
-case 210:
-#line 2283 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 272:
+#line 2613 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- const PointerType *PFTy;
- const FunctionType *Ty;
- if (!(PFTy = dyn_cast<PointerType>(yyvsp[-10].TypeVal->get())) ||
+ // Handle the short syntax
+ const PointerType *PFTy = 0;
+ const FunctionType *Ty = 0;
+ if (!(PFTy = dyn_cast<PointerType>(yyvsp[-11].TypeVal->get())) ||
!(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
// Pull out the types of all of the arguments...
std::vector<const Type*> ParamTypes;
- if (yyvsp[-7].ValueList) {
- for (std::vector<Value*>::iterator I = yyvsp[-7].ValueList->begin(), E = yyvsp[-7].ValueList->end();
- I != E; ++I)
- ParamTypes.push_back((*I)->getType());
+ ParamAttrsVector Attrs;
+ if (yyvsp[-6].ParamAttrs != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-6].ParamAttrs;
+ Attrs.push_back(PAWI);
+ }
+ ParamList::iterator I = yyvsp[-8].ParamList->begin(), E = yyvsp[-8].ParamList->end();
+ unsigned index = 1;
+ for (; I != E; ++I, ++index) {
+ const Type *Ty = I->Val->getType();
+ if (Ty == Type::VoidTy)
+ GEN_ERROR("Short call syntax cannot be used with varargs");
+ ParamTypes.push_back(Ty);
+ if (I->Attrs != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = index; PAWI.attrs = I->Attrs;
+ Attrs.push_back(PAWI);
+ }
}
- bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
- if (isVarArg) ParamTypes.pop_back();
-
- Ty = FunctionType::get(yyvsp[-10].TypeVal->get(), ParamTypes, isVarArg);
+ ParamAttrsList *PAL = 0;
+ if (!Attrs.empty())
+ PAL = ParamAttrsList::get(Attrs);
+ Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false, PAL);
PFTy = PointerType::get(Ty);
}
- Value *V = getVal(PFTy, yyvsp[-9].ValIDVal); // Get the function we're calling...
+ delete yyvsp[-11].TypeVal;
+
+ Value *V = getVal(PFTy, yyvsp[-10].ValIDVal); // Get the function we're calling...
CHECK_FOR_ERROR
BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal);
CHECK_FOR_ERROR
BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
- // Create the call node...
- if (!yyvsp[-7].ValueList) { // Has no arguments?
- yyval.TermInstVal = new InvokeInst(V, Normal, Except, std::vector<Value*>());
+ // Check the arguments
+ ValueList Args;
+ if (yyvsp[-8].ParamList->empty()) { // Has no arguments?
+ // Make sure no arguments is a good thing!
+ if (Ty->getNumParams() != 0)
+ GEN_ERROR("No arguments passed to a function that "
+ "expects arguments");
} else { // Has arguments?
// Loop through FunctionType's arguments and ensure they are specified
// correctly!
- //
FunctionType::param_iterator I = Ty->param_begin();
FunctionType::param_iterator E = Ty->param_end();
- std::vector<Value*>::iterator ArgI = yyvsp[-7].ValueList->begin(), ArgE = yyvsp[-7].ValueList->end();
-
- for (; ArgI != ArgE && I != E; ++ArgI, ++I)
- if ((*ArgI)->getType() != *I)
- GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" +
- (*I)->getDescription() + "'!");
+ ParamList::iterator ArgI = yyvsp[-8].ParamList->begin(), ArgE = yyvsp[-8].ParamList->end();
- if (I != E || (ArgI != ArgE && !Ty->isVarArg()))
- GEN_ERROR("Invalid number of parameters detected!");
+ for (; ArgI != ArgE && I != E; ++ArgI, ++I) {
+ if (ArgI->Val->getType() != *I)
+ GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
+ (*I)->getDescription() + "'");
+ Args.push_back(ArgI->Val);
+ }
- yyval.TermInstVal = new InvokeInst(V, Normal, Except, *yyvsp[-7].ValueList);
+ if (Ty->isVarArg()) {
+ if (I == E)
+ for (; ArgI != ArgE; ++ArgI)
+ Args.push_back(ArgI->Val); // push the remaining varargs
+ } else if (I != E || ArgI != ArgE)
+ GEN_ERROR("Invalid number of parameters detected");
}
- cast<InvokeInst>(yyval.TermInstVal)->setCallingConv(yyvsp[-11].UIntVal);
-
- delete yyvsp[-10].TypeVal;
- delete yyvsp[-7].ValueList;
+
+ // Create the InvokeInst
+ InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
+ II->setCallingConv(yyvsp[-12].UIntVal);
+ yyval.TermInstVal = II;
+ delete yyvsp[-8].ParamList;
CHECK_FOR_ERROR
;
break;}
-case 211:
-#line 2338 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 273:
+#line 2692 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.TermInstVal = new UnwindInst();
CHECK_FOR_ERROR
;
break;}
-case 212:
-#line 2342 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 274:
+#line 2696 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.TermInstVal = new UnreachableInst();
CHECK_FOR_ERROR
;
break;}
-case 213:
-#line 2349 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 275:
+#line 2703 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.JumpTable = yyvsp[-5].JumpTable;
- Constant *V = cast<Constant>(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal));
+ Constant *V = cast<Constant>(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal));
CHECK_FOR_ERROR
if (V == 0)
- GEN_ERROR("May only switch on a constant pool value!");
+ GEN_ERROR("May only switch on a constant pool value");
BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
yyval.JumpTable->push_back(std::make_pair(V, tmpBB));
;
break;}
-case 214:
-#line 2360 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 276:
+#line 2714 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.JumpTable = new std::vector<std::pair<Constant*, BasicBlock*> >();
- Constant *V = cast<Constant>(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal));
+ Constant *V = cast<Constant>(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal));
CHECK_FOR_ERROR
if (V == 0)
- GEN_ERROR("May only switch on a constant pool value!");
+ GEN_ERROR("May only switch on a constant pool value");
BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
yyval.JumpTable->push_back(std::make_pair(V, tmpBB));
;
break;}
-case 215:
-#line 2373 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 277:
+#line 2727 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- // Is this definition named?? if so, assign the name...
- setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal);
- CHECK_FOR_ERROR
- InsertValue(yyvsp[0].InstVal);
- yyval.InstVal = yyvsp[0].InstVal;
- CHECK_FOR_ERROR
-;
+ // Is this definition named?? if so, assign the name...
+ setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal);
+ CHECK_FOR_ERROR
+ InsertValue(yyvsp[0].InstVal);
+ yyval.InstVal = yyvsp[0].InstVal;
+ CHECK_FOR_ERROR
+ ;
break;}
-case 216:
-#line 2382 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 278:
+#line 2737 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Used for PHI nodes
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription());
yyval.PHIList = new std::list<std::pair<Value*, BasicBlock*> >();
Value* tmpVal = getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal);
CHECK_FOR_ERROR
delete yyvsp[-5].TypeVal;
;
break;}
-case 217:
-#line 2391 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 279:
+#line 2748 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.PHIList = yyvsp[-6].PHIList;
Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal);
yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB));
;
break;}
-case 218:
-#line 2401 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ // Used for call statements, and memory insts...
- yyval.ValueList = new std::vector<Value*>();
- yyval.ValueList->push_back(yyvsp[0].ValueVal);
+case 280:
+#line 2758 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
+ // Used for call and invoke instructions
+ yyval.ParamList = new ParamList();
+ ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal);
+ yyval.ParamList->push_back(E);
+ delete yyvsp[-2].TypeVal;
;
break;}
-case 219:
-#line 2405 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 281:
+#line 2767 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- yyval.ValueList = yyvsp[-2].ValueList;
- yyvsp[-2].ValueList->push_back(yyvsp[0].ValueVal);
+ // Labels are only valid in ASMs
+ yyval.ParamList = new ParamList();
+ ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal);
+ yyval.ParamList->push_back(E);
+ ;
+ break;}
+case 282:
+#line 2773 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
+ yyval.ParamList = yyvsp[-4].ParamList;
+ ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal);
+ yyval.ParamList->push_back(E);
+ delete yyvsp[-2].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 221:
-#line 2412 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{ yyval.ValueList = 0; ;
+case 283:
+#line 2782 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.ParamList = yyvsp[-4].ParamList;
+ ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal);
+ yyval.ParamList->push_back(E);
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 284:
+#line 2788 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ParamList = new ParamList(); ;
break;}
-case 222:
-#line 2414 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 285:
+#line 2791 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{ yyval.ValueList = new std::vector<Value*>(); ;
+ break;}
+case 286:
+#line 2792 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+{
+ yyval.ValueList = yyvsp[-2].ValueList;
+ yyval.ValueList->push_back(yyvsp[0].ValueVal);
+ CHECK_FOR_ERROR
+ ;
+ break;}
+case 287:
+#line 2799 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.BoolVal = true;
CHECK_FOR_ERROR
;
break;}
-case 223:
-#line 2418 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 288:
+#line 2803 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.BoolVal = false;
CHECK_FOR_ERROR
;
break;}
-case 224:
-#line 2423 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 289:
+#line 2808 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() &&
- !isa<PackedType>((*yyvsp[-3].TypeVal).get()))
+ !isa<VectorType>((*yyvsp[-3].TypeVal).get()))
GEN_ERROR(
- "Arithmetic operator requires integer, FP, or packed operands!");
- if (isa<PackedType>((*yyvsp[-3].TypeVal).get()) && yyvsp[-4].BinaryOpVal == Instruction::Rem)
- GEN_ERROR("Rem not supported on packed types!");
+ "Arithmetic operator requires integer, FP, or packed operands");
+ if (isa<VectorType>((*yyvsp[-3].TypeVal).get()) &&
+ (yyvsp[-4].BinaryOpVal == Instruction::URem ||
+ yyvsp[-4].BinaryOpVal == Instruction::SRem ||
+ yyvsp[-4].BinaryOpVal == Instruction::FRem))
+ GEN_ERROR("Remainder not supported on vector types");
Value* val1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal);
CHECK_FOR_ERROR
Value* val2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, val1, val2);
if (yyval.InstVal == 0)
- GEN_ERROR("binary operator returned null!");
+ GEN_ERROR("binary operator returned null");
delete yyvsp[-3].TypeVal;
;
break;}
-case 225:
-#line 2439 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 290:
+#line 2829 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if (!(*yyvsp[-3].TypeVal)->isIntegral()) {
- if (!isa<PackedType>(yyvsp[-3].TypeVal->get()) ||
- !cast<PackedType>(yyvsp[-3].TypeVal->get())->getElementType()->isIntegral())
- GEN_ERROR("Logical operator requires integral operands!");
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
+ if (!(*yyvsp[-3].TypeVal)->isInteger()) {
+ if (Instruction::isShift(yyvsp[-4].BinaryOpVal) || !isa<VectorType>(yyvsp[-3].TypeVal->get()) ||
+ !cast<VectorType>(yyvsp[-3].TypeVal->get())->getElementType()->isInteger())
+ GEN_ERROR("Logical operator requires integral operands");
}
Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal);
CHECK_FOR_ERROR
CHECK_FOR_ERROR
yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2);
if (yyval.InstVal == 0)
- GEN_ERROR("binary operator returned null!");
+ GEN_ERROR("binary operator returned null");
delete yyvsp[-3].TypeVal;
;
break;}
-case 226:
-#line 2454 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 291:
+#line 2846 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if(isa<PackedType>((*yyvsp[-3].TypeVal).get())) {
- GEN_ERROR(
- "PackedTypes currently not supported in setcc instructions!");
- }
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
+ if (isa<VectorType>((*yyvsp[-3].TypeVal).get()))
+ GEN_ERROR("Vector types not supported by icmp instruction");
Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal);
CHECK_FOR_ERROR
Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
- yyval.InstVal = new SetCondInst(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2);
+ yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].IPredicate, tmpVal1, tmpVal2);
if (yyval.InstVal == 0)
- GEN_ERROR("binary operator returned null!");
+ GEN_ERROR("icmp operator returned null");
delete yyvsp[-3].TypeVal;
;
break;}
-case 227:
-#line 2468 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 292:
+#line 2860 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- std::cerr << "WARNING: Use of eliminated 'not' instruction:"
- << " Replacing with 'xor'.\n";
-
- Value *Ones = ConstantIntegral::getAllOnesValue(yyvsp[0].ValueVal->getType());
- if (Ones == 0)
- GEN_ERROR("Expected integral type for not instruction!");
-
- yyval.InstVal = BinaryOperator::create(Instruction::Xor, yyvsp[0].ValueVal, Ones);
- if (yyval.InstVal == 0)
- GEN_ERROR("Could not create a xor instruction!");
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription());
+ if (isa<VectorType>((*yyvsp[-3].TypeVal).get()))
+ GEN_ERROR("Vector types not supported by fcmp instruction");
+ Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal);
CHECK_FOR_ERROR
- ;
- break;}
-case 228:
-#line 2481 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- if (yyvsp[0].ValueVal->getType() != Type::UByteTy)
- GEN_ERROR("Shift amount must be ubyte!");
- if (!yyvsp[-2].ValueVal->getType()->isInteger())
- GEN_ERROR("Shift constant expression requires integer operand!");
- yyval.InstVal = new ShiftInst(yyvsp[-3].OtherOpVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
+ Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal);
CHECK_FOR_ERROR
+ yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].FPredicate, tmpVal1, tmpVal2);
+ if (yyval.InstVal == 0)
+ GEN_ERROR("fcmp operator returned null");
+ delete yyvsp[-3].TypeVal;
;
break;}
-case 229:
-#line 2489 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 293:
+#line 2874 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if (!yyvsp[0].TypeVal->get()->isFirstClassType())
- GEN_ERROR("cast instruction to a non-primitive type: '" +
- yyvsp[0].TypeVal->get()->getDescription() + "'!");
- yyval.InstVal = new CastInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal);
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
+ Value* Val = yyvsp[-2].ValueVal;
+ const Type* DestTy = yyvsp[0].TypeVal->get();
+ if (!CastInst::castIsValid(yyvsp[-3].CastOpVal, Val, DestTy))
+ GEN_ERROR("invalid cast opcode for cast from '" +
+ Val->getType()->getDescription() + "' to '" +
+ DestTy->getDescription() + "'");
+ yyval.InstVal = CastInst::create(yyvsp[-3].CastOpVal, Val, DestTy);
delete yyvsp[0].TypeVal;
- CHECK_FOR_ERROR
;
break;}
-case 230:
-#line 2497 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 294:
+#line 2886 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if (yyvsp[-4].ValueVal->getType() != Type::BoolTy)
- GEN_ERROR("select condition must be boolean!");
+ if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty)
+ GEN_ERROR("select condition must be boolean");
if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType())
- GEN_ERROR("select value types should match!");
+ GEN_ERROR("select value types should match");
yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
CHECK_FOR_ERROR
;
break;}
-case 231:
-#line 2505 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 295:
+#line 2894 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- NewVarArgs = true;
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal);
delete yyvsp[0].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 232:
-#line 2511 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- ObsoleteVarArgs = true;
- const Type* ArgTy = yyvsp[-2].ValueVal->getType();
- Function* NF = CurModule.CurrentModule->
- getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0);
-
- //b = vaarg a, t ->
- //foo = alloca 1 of t
- //bar = vacopy a
- //store bar -> foo
- //b = vaarg foo, t
- AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix");
- CurBB->getInstList().push_back(foo);
- CallInst* bar = new CallInst(NF, yyvsp[-2].ValueVal);
- CurBB->getInstList().push_back(bar);
- CurBB->getInstList().push_back(new StoreInst(bar, foo));
- yyval.InstVal = new VAArgInst(foo, *yyvsp[0].TypeVal);
- delete yyvsp[0].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 233:
-#line 2531 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- ObsoleteVarArgs = true;
- const Type* ArgTy = yyvsp[-2].ValueVal->getType();
- Function* NF = CurModule.CurrentModule->
- getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0);
-
- //b = vanext a, t ->
- //foo = alloca 1 of t
- //bar = vacopy a
- //store bar -> foo
- //tmp = vaarg foo, t
- //b = load foo
- AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix");
- CurBB->getInstList().push_back(foo);
- CallInst* bar = new CallInst(NF, yyvsp[-2].ValueVal);
- CurBB->getInstList().push_back(bar);
- CurBB->getInstList().push_back(new StoreInst(bar, foo));
- Instruction* tmp = new VAArgInst(foo, *yyvsp[0].TypeVal);
- CurBB->getInstList().push_back(tmp);
- yyval.InstVal = new LoadInst(foo);
- delete yyvsp[0].TypeVal;
- CHECK_FOR_ERROR
- ;
- break;}
-case 234:
-#line 2554 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 296:
+#line 2901 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal))
- GEN_ERROR("Invalid extractelement operands!");
+ GEN_ERROR("Invalid extractelement operands");
yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
CHECK_FOR_ERROR
;
break;}
-case 235:
-#line 2560 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 297:
+#line 2907 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal))
- GEN_ERROR("Invalid insertelement operands!");
+ GEN_ERROR("Invalid insertelement operands");
yyval.InstVal = new InsertElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
CHECK_FOR_ERROR
;
break;}
-case 236:
-#line 2566 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 298:
+#line 2913 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal))
- GEN_ERROR("Invalid shufflevector operands!");
+ GEN_ERROR("Invalid shufflevector operands");
yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal);
CHECK_FOR_ERROR
;
break;}
-case 237:
-#line 2572 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 299:
+#line 2919 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
const Type *Ty = yyvsp[0].PHIList->front().first->getType();
if (!Ty->isFirstClassType())
- GEN_ERROR("PHI node operands must be of first class type!");
+ GEN_ERROR("PHI node operands must be of first class type");
yyval.InstVal = new PHINode(Ty);
((PHINode*)yyval.InstVal)->reserveOperandSpace(yyvsp[0].PHIList->size());
while (yyvsp[0].PHIList->begin() != yyvsp[0].PHIList->end()) {
if (yyvsp[0].PHIList->front().first->getType() != Ty)
- GEN_ERROR("All elements of a PHI node must be of the same type!");
+ GEN_ERROR("All elements of a PHI node must be of the same type");
cast<PHINode>(yyval.InstVal)->addIncoming(yyvsp[0].PHIList->front().first, yyvsp[0].PHIList->front().second);
yyvsp[0].PHIList->pop_front();
}
CHECK_FOR_ERROR
;
break;}
-case 238:
-#line 2587 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 300:
+#line 2935 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- const PointerType *PFTy;
- const FunctionType *Ty;
- if (!(PFTy = dyn_cast<PointerType>(yyvsp[-4].TypeVal->get())) ||
+ // Handle the short syntax
+ const PointerType *PFTy = 0;
+ const FunctionType *Ty = 0;
+ if (!(PFTy = dyn_cast<PointerType>(yyvsp[-5].TypeVal->get())) ||
!(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
// Pull out the types of all of the arguments...
std::vector<const Type*> ParamTypes;
- if (yyvsp[-1].ValueList) {
- for (std::vector<Value*>::iterator I = yyvsp[-1].ValueList->begin(), E = yyvsp[-1].ValueList->end();
- I != E; ++I)
- ParamTypes.push_back((*I)->getType());
+ ParamAttrsVector Attrs;
+ if (yyvsp[0].ParamAttrs != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[0].ParamAttrs;
+ Attrs.push_back(PAWI);
+ }
+ unsigned index = 1;
+ ParamList::iterator I = yyvsp[-2].ParamList->begin(), E = yyvsp[-2].ParamList->end();
+ for (; I != E; ++I, ++index) {
+ const Type *Ty = I->Val->getType();
+ if (Ty == Type::VoidTy)
+ GEN_ERROR("Short call syntax cannot be used with varargs");
+ ParamTypes.push_back(Ty);
+ if (I->Attrs != ParamAttr::None) {
+ ParamAttrsWithIndex PAWI; PAWI.index = index; PAWI.attrs = I->Attrs;
+ Attrs.push_back(PAWI);
+ }
}
- bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
- if (isVarArg) ParamTypes.pop_back();
-
- if (!(*yyvsp[-4].TypeVal)->isFirstClassType() && *yyvsp[-4].TypeVal != Type::VoidTy)
- GEN_ERROR("LLVM functions cannot return aggregate types!");
+ ParamAttrsList *PAL = 0;
+ if (!Attrs.empty())
+ PAL = ParamAttrsList::get(Attrs);
- Ty = FunctionType::get(yyvsp[-4].TypeVal->get(), ParamTypes, isVarArg);
+ Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false, PAL);
PFTy = PointerType::get(Ty);
}
- Value *V = getVal(PFTy, yyvsp[-3].ValIDVal); // Get the function we're calling...
+ Value *V = getVal(PFTy, yyvsp[-4].ValIDVal); // Get the function we're calling...
CHECK_FOR_ERROR
- // Create the call node...
- if (!yyvsp[-1].ValueList) { // Has no arguments?
+ // Check for call to invalid intrinsic to avoid crashing later.
+ if (Function *theF = dyn_cast<Function>(V)) {
+ if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
+ (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
+ !theF->getIntrinsicID(true))
+ GEN_ERROR("Call to invalid LLVM intrinsic function '" +
+ theF->getName() + "'");
+ }
+
+ // Check the arguments
+ ValueList Args;
+ if (yyvsp[-2].ParamList->empty()) { // Has no arguments?
// Make sure no arguments is a good thing!
if (Ty->getNumParams() != 0)
GEN_ERROR("No arguments passed to a function that "
- "expects arguments!");
-
- yyval.InstVal = new CallInst(V, std::vector<Value*>());
+ "expects arguments");
} else { // Has arguments?
// Loop through FunctionType's arguments and ensure they are specified
// correctly!
//
FunctionType::param_iterator I = Ty->param_begin();
FunctionType::param_iterator E = Ty->param_end();
- std::vector<Value*>::iterator ArgI = yyvsp[-1].ValueList->begin(), ArgE = yyvsp[-1].ValueList->end();
-
- for (; ArgI != ArgE && I != E; ++ArgI, ++I)
- if ((*ArgI)->getType() != *I)
- GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" +
- (*I)->getDescription() + "'!");
-
- if (I != E || (ArgI != ArgE && !Ty->isVarArg()))
- GEN_ERROR("Invalid number of parameters detected!");
+ ParamList::iterator ArgI = yyvsp[-2].ParamList->begin(), ArgE = yyvsp[-2].ParamList->end();
- yyval.InstVal = new CallInst(V, *yyvsp[-1].ValueList);
+ for (; ArgI != ArgE && I != E; ++ArgI, ++I) {
+ if (ArgI->Val->getType() != *I)
+ GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
+ (*I)->getDescription() + "'");
+ Args.push_back(ArgI->Val);
+ }
+ if (Ty->isVarArg()) {
+ if (I == E)
+ for (; ArgI != ArgE; ++ArgI)
+ Args.push_back(ArgI->Val); // push the remaining varargs
+ } else if (I != E || ArgI != ArgE)
+ GEN_ERROR("Invalid number of parameters detected");
}
- cast<CallInst>(yyval.InstVal)->setTailCall(yyvsp[-6].BoolVal);
- cast<CallInst>(yyval.InstVal)->setCallingConv(yyvsp[-5].UIntVal);
- delete yyvsp[-4].TypeVal;
- delete yyvsp[-1].ValueList;
+ // Create the call node
+ CallInst *CI = new CallInst(V, Args.begin(), Args.end());
+ CI->setTailCall(yyvsp[-7].BoolVal);
+ CI->setCallingConv(yyvsp[-6].UIntVal);
+ yyval.InstVal = CI;
+ delete yyvsp[-2].ParamList;
+ delete yyvsp[-5].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 239:
-#line 2646 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 301:
+#line 3019 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.InstVal = yyvsp[0].InstVal;
CHECK_FOR_ERROR
;
break;}
-case 240:
-#line 2653 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValueList = yyvsp[0].ValueList;
- CHECK_FOR_ERROR
- ;
- break;}
-case 241:
-#line 2656 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- yyval.ValueList = new std::vector<Value*>();
- CHECK_FOR_ERROR
- ;
- break;}
-case 242:
-#line 2661 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 302:
+#line 3024 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.BoolVal = true;
CHECK_FOR_ERROR
;
break;}
-case 243:
-#line 2665 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 303:
+#line 3028 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
yyval.BoolVal = false;
CHECK_FOR_ERROR
;
break;}
-case 244:
-#line 2672 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 304:
+#line 3035 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal);
delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 245:
-#line 2677 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 305:
+#line 3042 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription());
Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal);
CHECK_FOR_ERROR
yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal);
delete yyvsp[-4].TypeVal;
;
break;}
-case 246:
-#line 2683 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 306:
+#line 3050 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription());
yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal);
delete yyvsp[-1].TypeVal;
CHECK_FOR_ERROR
;
break;}
-case 247:
-#line 2688 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 307:
+#line 3057 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription());
Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal);
CHECK_FOR_ERROR
yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal);
delete yyvsp[-4].TypeVal;
;
break;}
-case 248:
-#line 2694 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 308:
+#line 3065 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa<PointerType>(yyvsp[0].ValueVal->getType()))
GEN_ERROR("Trying to free nonpointer type " +
- yyvsp[0].ValueVal->getType()->getDescription() + "!");
+ yyvsp[0].ValueVal->getType()->getDescription() + "");
yyval.InstVal = new FreeInst(yyvsp[0].ValueVal);
CHECK_FOR_ERROR
;
break;}
-case 249:
-#line 2702 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 309:
+#line 3073 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- if (!isa<PointerType>(yyvsp[-1].TypeVal->get()))
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
+ if (!isa<PointerType>(yyvsp[-2].TypeVal->get()))
GEN_ERROR("Can't load from nonpointer type: " +
- (*yyvsp[-1].TypeVal)->getDescription());
- if (!cast<PointerType>(yyvsp[-1].TypeVal->get())->getElementType()->isFirstClassType())
+ (*yyvsp[-2].TypeVal)->getDescription());
+ if (!cast<PointerType>(yyvsp[-2].TypeVal->get())->getElementType()->isFirstClassType())
GEN_ERROR("Can't load from pointer of non-first-class type: " +
- (*yyvsp[-1].TypeVal)->getDescription());
- Value* tmpVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal);
+ (*yyvsp[-2].TypeVal)->getDescription());
+ Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal);
CHECK_FOR_ERROR
- yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-3].BoolVal);
- delete yyvsp[-1].TypeVal;
+ yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-4].BoolVal, yyvsp[0].UIntVal);
+ delete yyvsp[-2].TypeVal;
;
break;}
-case 250:
-#line 2714 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 310:
+#line 3087 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
- const PointerType *PT = dyn_cast<PointerType>(yyvsp[-1].TypeVal->get());
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
+ const PointerType *PT = dyn_cast<PointerType>(yyvsp[-2].TypeVal->get());
if (!PT)
GEN_ERROR("Can't store to a nonpointer type: " +
- (*yyvsp[-1].TypeVal)->getDescription());
+ (*yyvsp[-2].TypeVal)->getDescription());
const Type *ElTy = PT->getElementType();
- if (ElTy != yyvsp[-3].ValueVal->getType())
- GEN_ERROR("Can't store '" + yyvsp[-3].ValueVal->getType()->getDescription() +
- "' into space of type '" + ElTy->getDescription() + "'!");
+ if (ElTy != yyvsp[-4].ValueVal->getType())
+ GEN_ERROR("Can't store '" + yyvsp[-4].ValueVal->getType()->getDescription() +
+ "' into space of type '" + ElTy->getDescription() + "'");
- Value* tmpVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal);
+ Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal);
CHECK_FOR_ERROR
- yyval.InstVal = new StoreInst(yyvsp[-3].ValueVal, tmpVal, yyvsp[-5].BoolVal);
- delete yyvsp[-1].TypeVal;
+ yyval.InstVal = new StoreInst(yyvsp[-4].ValueVal, tmpVal, yyvsp[-6].BoolVal, yyvsp[0].UIntVal);
+ delete yyvsp[-2].TypeVal;
;
break;}
-case 251:
-#line 2729 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+case 311:
+#line 3104 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
{
+ if (!UpRefs.empty())
+ GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription());
if (!isa<PointerType>(yyvsp[-2].TypeVal->get()))
- GEN_ERROR("getelementptr insn requires pointer operand!");
-
- // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct
- // indices to uint struct indices for compatibility.
- generic_gep_type_iterator<std::vector<Value*>::iterator>
- GTI = gep_type_begin(yyvsp[-2].TypeVal->get(), yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end()),
- GTE = gep_type_end(yyvsp[-2].TypeVal->get(), yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end());
- for (unsigned i = 0, e = yyvsp[0].ValueList->size(); i != e && GTI != GTE; ++i, ++GTI)
- if (isa<StructType>(*GTI)) // Only change struct indices
- if (ConstantUInt *CUI = dyn_cast<ConstantUInt>((*yyvsp[0].ValueList)[i]))
- if (CUI->getType() == Type::UByteTy)
- (*yyvsp[0].ValueList)[i] = ConstantExpr::getCast(CUI, Type::UIntTy);
-
- if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, *yyvsp[0].ValueList, true))
+ GEN_ERROR("getelementptr insn requires pointer operand");
+
+ if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end(), true))
GEN_ERROR("Invalid getelementptr indices for type '" +
- (*yyvsp[-2].TypeVal)->getDescription()+ "'!");
+ (*yyvsp[-2].TypeVal)->getDescription()+ "'");
Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal);
CHECK_FOR_ERROR
- yyval.InstVal = new GetElementPtrInst(tmpVal, *yyvsp[0].ValueList);
+ yyval.InstVal = new GetElementPtrInst(tmpVal, yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end());
delete yyvsp[-2].TypeVal;
delete yyvsp[0].ValueList;
;
}
return 1;
}
-#line 2755 "/Users/resistor/llvm/src/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 3121 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y"
+
+
+// common code from the two 'RunVMAsmParser' functions
+static Module* RunParser(Module * M) {
+
+ llvmAsmlineno = 1; // Reset the current line number...
+ CurModule.CurrentModule = M;
+#if YYDEBUG
+ yydebug = Debug;
+#endif
+ // Check to make sure the parser succeeded
+ if (yyparse()) {
+ if (ParserResult)
+ delete ParserResult;
+ return 0;
+ }
+
+ // Emit an error if there are any unresolved types left.
+ if (!CurModule.LateResolveTypes.empty()) {
+ const ValID &DID = CurModule.LateResolveTypes.begin()->first;
+ if (DID.Type == ValID::LocalName) {
+ GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
+ } else {
+ GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
+ }
+ if (ParserResult)
+ delete ParserResult;
+ return 0;
+ }
+
+ // Emit an error if there are any unresolved values left.
+ if (!CurModule.LateResolveValues.empty()) {
+ Value *V = CurModule.LateResolveValues.back();
+ std::map<Value*, std::pair<ValID, int> >::iterator I =
+ CurModule.PlaceHolderInfo.find(V);
+
+ if (I != CurModule.PlaceHolderInfo.end()) {
+ ValID &DID = I->second.first;
+ if (DID.Type == ValID::LocalName) {
+ GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
+ } else {
+ GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
+ }
+ if (ParserResult)
+ delete ParserResult;
+ return 0;
+ }
+ }
+
+ // Check to make sure that parsing produced a result
+ if (!ParserResult)
+ return 0;
+
+ // Reset ParserResult variable while saving its value for the result.
+ Module *Result = ParserResult;
+ ParserResult = 0;
+
+ return Result;
+}
void llvm::GenerateError(const std::string &message, int LineNo) {
if (LineNo == -1) LineNo = llvmAsmlineno;
std::string where
= std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
+ ":" + utostr((unsigned) llvmAsmlineno) + ": ";
- std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
- if (yychar == YYEMPTY || yychar == 0)
- errMsg += "end-of-file.";
- else
- errMsg += "token: '" + std::string(llvmAsmtext, llvmAsmleng) + "'";
+ std::string errMsg = where + "error: " + std::string(ErrorMsg);
+ if (yychar != YYEMPTY && yychar != 0)
+ errMsg += " while reading token: '" + std::string(llvmAsmtext, llvmAsmleng)+
+ "'";
GenerateError(errMsg);
return 0;
}