[svn r149] fixed: a bunch of D-style variadics problems.

fixed: GotoDefaultStatement implemented.
fixed: some other minor bugs.
This commit is contained in:
Tomas Lindquist Olsen
2008-01-26 17:13:22 +01:00
parent adc75dd377
commit 64537a9478
12 changed files with 158 additions and 36 deletions

View File

@@ -321,7 +321,12 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
bool declareOnly = false;
bool templInst = fdecl->parent && DtoIsTemplateInstance(fdecl->parent);
if (!templInst && fdecl->getModule() != gIR->dmodule)
{
Logger::println("not template instance, and not in this module. declare only!");
Logger::println("current module: %s", gIR->dmodule->ident->toChars());
Logger::println("func module: %s", fdecl->getModule()->ident->toChars());
declareOnly = true;
}
else if (fdecl->llvmInternal == LLVMva_start)
declareOnly = true;
@@ -548,11 +553,15 @@ void DtoDefineFunc(FuncDeclaration* fd)
}
for (std::set<VarDeclaration*>::iterator i=fd->nestedVars.begin(); i!=fd->nestedVars.end(); ++i) {
VarDeclaration* vd = *i;
Logger::println("referenced nested variable %s", vd->toChars());
if (!vd->irLocal)
vd->irLocal = new IrLocal(vd);
vd->irLocal->nestedIndex = j++;
if (vd->isParameter()) {
if (!vd->irLocal->value) {
assert(vd == fd->vthis);
vd->irLocal->value = fd->irFunc->thisVar;
}
assert(vd->irLocal->value);
nestTypes.push_back(vd->irLocal->value->getType());
}