comparison gen/functions.cpp @ 116:fd7ad91fd713 trunk

[svn r120] ModuleInfo implementation is now almost complete. Fixed some nasty static array-initializer bugs. Fixed bug in DtoArrayLen and DtoArrayPtr for full slices of static arrays.
author lindquist
date Sun, 25 Nov 2007 18:55:52 +0100
parents 27b9f749d9fe
children 56a21f3e5d3e
comparison
equal deleted inserted replaced
115:5ba6d286c941 116:fd7ad91fd713
366 func->setLinkage(llvm::GlobalValue::WeakLinkage); 366 func->setLinkage(llvm::GlobalValue::WeakLinkage);
367 367
368 fdecl->llvmValue = func; 368 fdecl->llvmValue = func;
369 assert(llvm::isa<llvm::FunctionType>(f->llvmType->get())); 369 assert(llvm::isa<llvm::FunctionType>(f->llvmType->get()));
370 370
371 // main
371 if (fdecl->isMain()) { 372 if (fdecl->isMain()) {
372 gIR->mainFunc = func; 373 gIR->mainFunc = func;
374 }
375
376 // static ctor
377 if (fdecl->isStaticCtorDeclaration()) {
378 gIR->ctors.push_back(fdecl);
379 }
380 // static dtor
381 else if (fdecl->isStaticDtorDeclaration()) {
382 gIR->dtors.push_back(fdecl);
373 } 383 }
374 384
375 // name parameters 385 // name parameters
376 llvm::Function::arg_iterator iarg = func->arg_begin(); 386 llvm::Function::arg_iterator iarg = func->arg_begin();
377 int k = 0; 387 int k = 0;