Regenerate

llvm-svn: 44546
This commit is contained in:
Anton Korobeynikov 2007-12-03 21:01:29 +00:00
parent dcec56301a
commit 75a3208bb0
2 changed files with 210 additions and 196 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1331,22 +1331,26 @@ Types
// Allow but ignore attributes on function types; this permits auto-upgrade. // Allow but ignore attributes on function types; this permits auto-upgrade.
// FIXME: remove in LLVM 3.0. // FIXME: remove in LLVM 3.0.
const Type* RetTy = *$1; const Type* RetTy = *$1;
if (!(RetTy->isFirstClassType() || isa<OpaqueType>(RetTy))) if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy ||
isa<OpaqueType>(RetTy)))
GEN_ERROR("LLVM Functions cannot return aggregates"); GEN_ERROR("LLVM Functions cannot return aggregates");
std::vector<const Type*> Params; std::vector<const Type*> Params;
TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); TypeWithAttrsList::iterator I = $3->begin(), E = $3->end();
for (; I != E; ++I ) { for (; I != E; ++I ) {
const Type *Ty = I->Ty->get(); const Type *Ty = I->Ty->get();
if (!(Ty->isFirstClassType() || isa<OpaqueType>(Ty)))
GEN_ERROR("Function arguments must be value types!");
Params.push_back(Ty); Params.push_back(Ty);
} }
CHECK_FOR_ERROR
bool isVarArg = Params.size() && Params.back() == Type::VoidTy; bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
if (isVarArg) Params.pop_back(); if (isVarArg) Params.pop_back();
for (unsigned i = 0; i != Params.size(); ++i)
if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
GEN_ERROR("Function arguments must be value types!");
CHECK_FOR_ERROR
FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg); FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
delete $3; // Delete the argument list delete $3; // Delete the argument list
delete $1; // Delete the return type handle delete $1; // Delete the return type handle
@ -1360,15 +1364,18 @@ Types
TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); TypeWithAttrsList::iterator I = $3->begin(), E = $3->end();
for ( ; I != E; ++I ) { for ( ; I != E; ++I ) {
const Type* Ty = I->Ty->get(); const Type* Ty = I->Ty->get();
if (!(Ty->isFirstClassType() || isa<OpaqueType>(Ty)))
GEN_ERROR("Function arguments must be value types!");
Params.push_back(Ty); Params.push_back(Ty);
} }
CHECK_FOR_ERROR
bool isVarArg = Params.size() && Params.back() == Type::VoidTy; bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
if (isVarArg) Params.pop_back(); if (isVarArg) Params.pop_back();
for (unsigned i = 0; i != Params.size(); ++i)
if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
GEN_ERROR("Function arguments must be value types!");
CHECK_FOR_ERROR
FunctionType *FT = FunctionType::get($1, Params, isVarArg); FunctionType *FT = FunctionType::get($1, Params, isVarArg);
delete $3; // Delete the argument list delete $3; // Delete the argument list
$$ = new PATypeHolder(HandleUpRefs(FT)); $$ = new PATypeHolder(HandleUpRefs(FT));