comparison gen/functions.cpp @ 144:a27941d00351 trunk

[svn r149] fixed: a bunch of D-style variadics problems. fixed: GotoDefaultStatement implemented. fixed: some other minor bugs.
author lindquist
date Sat, 26 Jan 2008 17:13:22 +0100
parents 0ab29b838084
children 4c577c2b7229
comparison
equal deleted inserted replaced
143:336ec4f4bbb3 144:a27941d00351
319 } 319 }
320 320
321 bool declareOnly = false; 321 bool declareOnly = false;
322 bool templInst = fdecl->parent && DtoIsTemplateInstance(fdecl->parent); 322 bool templInst = fdecl->parent && DtoIsTemplateInstance(fdecl->parent);
323 if (!templInst && fdecl->getModule() != gIR->dmodule) 323 if (!templInst && fdecl->getModule() != gIR->dmodule)
324 {
325 Logger::println("not template instance, and not in this module. declare only!");
326 Logger::println("current module: %s", gIR->dmodule->ident->toChars());
327 Logger::println("func module: %s", fdecl->getModule()->ident->toChars());
324 declareOnly = true; 328 declareOnly = true;
329 }
325 else if (fdecl->llvmInternal == LLVMva_start) 330 else if (fdecl->llvmInternal == LLVMva_start)
326 declareOnly = true; 331 declareOnly = true;
327 332
328 if (!fdecl->irFunc) { 333 if (!fdecl->irFunc) {
329 fdecl->irFunc = new IrFunction(fdecl); 334 fdecl->irFunc = new IrFunction(fdecl);
546 nestTypes.push_back(parentNested->getType()); 551 nestTypes.push_back(parentNested->getType());
547 j++; 552 j++;
548 } 553 }
549 for (std::set<VarDeclaration*>::iterator i=fd->nestedVars.begin(); i!=fd->nestedVars.end(); ++i) { 554 for (std::set<VarDeclaration*>::iterator i=fd->nestedVars.begin(); i!=fd->nestedVars.end(); ++i) {
550 VarDeclaration* vd = *i; 555 VarDeclaration* vd = *i;
556 Logger::println("referenced nested variable %s", vd->toChars());
551 if (!vd->irLocal) 557 if (!vd->irLocal)
552 vd->irLocal = new IrLocal(vd); 558 vd->irLocal = new IrLocal(vd);
553 vd->irLocal->nestedIndex = j++; 559 vd->irLocal->nestedIndex = j++;
554 if (vd->isParameter()) { 560 if (vd->isParameter()) {
555 561 if (!vd->irLocal->value) {
562 assert(vd == fd->vthis);
563 vd->irLocal->value = fd->irFunc->thisVar;
564 }
556 assert(vd->irLocal->value); 565 assert(vd->irLocal->value);
557 nestTypes.push_back(vd->irLocal->value->getType()); 566 nestTypes.push_back(vd->irLocal->value->getType());
558 } 567 }
559 else { 568 else {
560 nestTypes.push_back(DtoType(vd->type)); 569 nestTypes.push_back(DtoType(vd->type));