comparison gen/functions.cpp @ 113:27b9f749d9fe trunk

[svn r117] Initial working implementation of interfaces. Groundwork for all the different types of class/interface casts laid out.
author lindquist
date Sat, 24 Nov 2007 06:33:00 +0100
parents 5ab8e92611f9
children fd7ad91fd713
comparison
equal deleted inserted replaced
112:368547b1cbe6 113:27b9f749d9fe
190 const llvm::Type* thisty = NULL; 190 const llvm::Type* thisty = NULL;
191 if (fdecl->needThis()) { 191 if (fdecl->needThis()) {
192 if (AggregateDeclaration* ad = fdecl->isMember()) { 192 if (AggregateDeclaration* ad = fdecl->isMember()) {
193 Logger::print("isMember = this is: %s\n", ad->type->toChars()); 193 Logger::print("isMember = this is: %s\n", ad->type->toChars());
194 thisty = DtoType(ad->type); 194 thisty = DtoType(ad->type);
195 Logger::cout() << "this llvm type: " << *thisty << '\n'; 195 //Logger::cout() << "this llvm type: " << *thisty << '\n';
196 if (isaStruct(thisty) || (!gIR->structs.empty() && thisty == gIR->topstruct()->recty.get())) 196 if (isaStruct(thisty) || (!gIR->structs.empty() && thisty == gIR->topstruct()->recty.get()))
197 thisty = llvm::PointerType::get(thisty); 197 thisty = llvm::PointerType::get(thisty);
198 } 198 }
199 else 199 else
200 assert(0); 200 assert(0);
275 } 275 }
276 276
277 DtoFunctionType(fdecl); 277 DtoFunctionType(fdecl);
278 278
279 // queue declaration 279 // queue declaration
280 gIR->declareList.push_back(fdecl); 280 if (!fdecl->isAbstract())
281 gIR->declareList.push_back(fdecl);
281 } 282 }
282 283
283 ////////////////////////////////////////////////////////////////////////////////////////// 284 //////////////////////////////////////////////////////////////////////////////////////////
284 285
285 void DtoDeclareFunction(FuncDeclaration* fdecl) 286 void DtoDeclareFunction(FuncDeclaration* fdecl)
287 if (fdecl->llvmDeclared) return; 288 if (fdecl->llvmDeclared) return;
288 fdecl->llvmDeclared = true; 289 fdecl->llvmDeclared = true;
289 290
290 Logger::println("DtoDeclareFunction(%s)", fdecl->toPrettyChars()); 291 Logger::println("DtoDeclareFunction(%s)", fdecl->toPrettyChars());
291 LOG_SCOPE; 292 LOG_SCOPE;
293
294 assert(!fdecl->isAbstract());
292 295
293 if (fdecl->llvmRunTimeHack) { 296 if (fdecl->llvmRunTimeHack) {
294 Logger::println("runtime hack func chars: %s", fdecl->toChars()); 297 Logger::println("runtime hack func chars: %s", fdecl->toChars());
295 if (!fdecl->llvmValue) 298 if (!fdecl->llvmValue)
296 fdecl->llvmValue = LLVM_D_GetRuntimeFunction(gIR->module, fdecl->toChars()); 299 fdecl->llvmValue = LLVM_D_GetRuntimeFunction(gIR->module, fdecl->toChars());