diff 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
line wrap: on
line diff
--- a/gen/functions.cpp	Sun Nov 25 03:58:55 2007 +0100
+++ b/gen/functions.cpp	Sun Nov 25 18:55:52 2007 +0100
@@ -368,10 +368,20 @@
     fdecl->llvmValue = func;
     assert(llvm::isa<llvm::FunctionType>(f->llvmType->get()));
 
+    // main
     if (fdecl->isMain()) {
         gIR->mainFunc = func;
     }
 
+    // static ctor
+    if (fdecl->isStaticCtorDeclaration()) {
+        gIR->ctors.push_back(fdecl);
+    }
+    // static dtor
+    else if (fdecl->isStaticDtorDeclaration()) {
+        gIR->dtors.push_back(fdecl);
+    }
+
     // name parameters
     llvm::Function::arg_iterator iarg = func->arg_begin();
     int k = 0;