comparison gen/functions.cpp @ 1248:01909bd1132c

Merge.
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Tue, 21 Apr 2009 17:54:43 +0200
parents a16b587aab58 1e699a4e9759
children 4b0b470bb2f9
comparison
equal deleted inserted replaced
1227:a16b587aab58 1248:01909bd1132c
224 } 224 }
225 225
226 llvm::FunctionType* functype = llvm::FunctionType::get(f->fty.ret->ltype, argtypes, f->fty.c_vararg); 226 llvm::FunctionType* functype = llvm::FunctionType::get(f->fty.ret->ltype, argtypes, f->fty.c_vararg);
227 f->ir.type = new llvm::PATypeHolder(functype); 227 f->ir.type = new llvm::PATypeHolder(functype);
228 228
229 #if 0
229 Logger::cout() << "Final function type: " << *functype << "\n"; 230 Logger::cout() << "Final function type: " << *functype << "\n";
231 #endif
230 232
231 return functype; 233 return functype;
232 } 234 }
233 235
234 ////////////////////////////////////////////////////////////////////////////////////////// 236 //////////////////////////////////////////////////////////////////////////////////////////
325 void DtoResolveFunction(FuncDeclaration* fdecl) 327 void DtoResolveFunction(FuncDeclaration* fdecl)
326 { 328 {
327 if (!global.params.useUnitTests && fdecl->isUnitTestDeclaration()) { 329 if (!global.params.useUnitTests && fdecl->isUnitTestDeclaration()) {
328 Logger::println("Ignoring unittest %s", fdecl->toPrettyChars()); 330 Logger::println("Ignoring unittest %s", fdecl->toPrettyChars());
329 return; // ignore declaration completely 331 return; // ignore declaration completely
330 }
331
332 if (AggregateDeclaration* ad = fdecl->isMember())
333 {
334 ad->codegen(Type::sir);
335 if (ad->isStructDeclaration() && llvm::isa<llvm::OpaqueType>(DtoType(ad->type)))
336 {
337 ad->ir.irStruct->structFuncs.push_back(fdecl);
338 return;
339 }
340 } 332 }
341 333
342 //printf("resolve function: %s\n", fdecl->toPrettyChars()); 334 //printf("resolve function: %s\n", fdecl->toPrettyChars());
343 335
344 if (fdecl->parent) 336 if (fdecl->parent)
395 LOG_SCOPE; 387 LOG_SCOPE;
396 388
397 // queue declaration unless the function is abstract without body 389 // queue declaration unless the function is abstract without body
398 if (!fdecl->isAbstract() || fdecl->fbody) 390 if (!fdecl->isAbstract() || fdecl->fbody)
399 { 391 {
400 Logger::println("Ignoring declaration of abstract bodyless function %s", fdecl->toPrettyChars());
401 DtoDeclareFunction(fdecl); 392 DtoDeclareFunction(fdecl);
402 } 393 }
403 } 394 }
404 395
405 ////////////////////////////////////////////////////////////////////////////////////////// 396 //////////////////////////////////////////////////////////////////////////////////////////