[svn r350] Fixed incorrect function types for lazy arguments. looks like lazy arguments have never even worked :o well.. now they should.

This commit is contained in:
Tomas Lindquist Olsen 2008-07-11 01:34:04 +02:00
parent 521de1a47e
commit 8c48f86f0a
2 changed files with 24 additions and 0 deletions

View file

@ -141,6 +141,17 @@ const llvm::FunctionType* DtoFunctionType(Type* type, const LLType* thistype, bo
paramvec.push_back(at);
}
// handle lazy args
if (arg->storageClass & STClazy)
{
Logger::cout() << "for lazy got: " << *paramvec.back() << '\n';
TypeFunction *ltf = new TypeFunction(NULL, arg->type, 0, LINKd);
TypeDelegate *ltd = new TypeDelegate(ltf);
at = getPtrToType(DtoType(ltd));
Logger::cout() << "lazy updated to: " << *at << '\n';
paramvec.back() = at;
}
if (arg->llvmByVal)
nbyval++;
}