diff gen/toobj.c @ 74:eb379601d445 trunk

[svn r78] Removed the useless pragmas
author lindquist
date Wed, 31 Oct 2007 04:05:38 +0100
parents b706170e24a9
children 714057ff2dbb
line wrap: on
line diff
--- a/gen/toobj.c	Wed Oct 31 03:11:32 2007 +0100
+++ b/gen/toobj.c	Wed Oct 31 04:05:38 2007 +0100
@@ -592,14 +592,6 @@
     LOG_SCOPE;
     llvm::Module* M = gIR->module;
 
-    // handle bind pragma
-    if (llvmInternal == LLVMbind) {
-        Logger::println("var is bound: %s", llvmInternal1);
-        llvmValue = M->getGlobalVariable(llvmInternal1);  
-        assert(llvmValue);
-        return;
-    }
-
     // global variable or magic
     if (isDataseg() || parent->isModule())
     {
@@ -796,7 +788,6 @@
     {
         llvmDModule = gIR->dmodule;
 
-        bool allow_fbody = true;
         // handle static constructor / destructor
         if (isStaticCtorDeclaration() || isStaticDtorDeclaration()) {
             const llvm::ArrayType* sctor_type = llvm::ArrayType::get(llvm::PointerType::get(functype),1);
@@ -805,17 +796,7 @@
             llvm::Constant* sctor_func = llvm::cast<llvm::Constant>(llvmValue);
             //Logger::cout() << "static ctor func: " << *sctor_func << '\n';
 
-            llvm::Constant* sctor_init = 0;
-            if (llvmInternal == LLVMnull)
-            {
-                llvm::Constant* sctor_init_null = llvm::Constant::getNullValue(sctor_func->getType());
-                sctor_init = llvm::ConstantArray::get(sctor_type,&sctor_init_null,1);
-                allow_fbody = false;
-            }
-            else
-            {
-                sctor_init = llvm::ConstantArray::get(sctor_type,&sctor_func,1);
-            }
+            llvm::Constant* sctor_init = llvm::ConstantArray::get(sctor_type,&sctor_func,1);
 
             //Logger::cout() << "static ctor init: " << *sctor_init << '\n';
 
@@ -825,7 +806,7 @@
         }
 
         // function definition
-        if (allow_fbody && fbody != 0)
+        if (fbody != 0)
         {
             gIR->functions.push_back(IRFunction(this));
             gIR->func().func = func;