Fixed problem with using the variable names _arguments and _argptr in non D-style vararg functions.

Fixed problem with compiling with LLVM 2.3
This commit is contained in:
Tomas Lindquist Olsen
2008-08-03 16:10:00 +02:00
parent aff505ea6e
commit dedc0f4829
2 changed files with 3 additions and 5 deletions

View File

@@ -60,19 +60,17 @@ DValue* VarExp::toElem(IRState* p)
Logger::println("VarDeclaration %s", vd->toChars());
// _arguments
if (vd->ident == Id::_arguments)
if (vd->ident == Id::_arguments && p->func()->_arguments)
{
Logger::println("Id::_arguments");
LLValue* v = p->func()->_arguments;
assert(v);
return new DVarValue(type, vd, v, true);
}
// _argptr
else if (vd->ident == Id::_argptr)
else if (vd->ident == Id::_argptr && p->func()->_argptr)
{
Logger::println("Id::_argptr");
LLValue* v = p->func()->_argptr;
assert(v);
return new DVarValue(type, vd, v, true);
}
// _dollar

View File

@@ -556,7 +556,7 @@ bool DtoCanLoad(LLValue* ptr)
{
if (isaPointer(ptr->getType())) {
const LLType* data = ptr->getType()->getContainedType(0);
return data->isFirstClassType() && !data->isAggregateType();
return data->isFirstClassType() && !(isaStruct(data) || isaArray(data));
}
return false;
}