diff gen/functions.cpp @ 1228:79758fd2f48a

Added Doxygen file. Completely seperated type and symbol generation. Should fix a lot of bugs, but is not yet 100% complete.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Wed, 15 Apr 2009 20:06:25 +0200
parents 8699c450a1a0
children 79c6c8bc866c
line wrap: on
line diff
--- a/gen/functions.cpp	Mon Apr 13 17:42:36 2009 +0200
+++ b/gen/functions.cpp	Wed Apr 15 20:06:25 2009 +0200
@@ -201,7 +201,9 @@
     llvm::FunctionType* functype = llvm::FunctionType::get(f->fty.ret->ltype, argtypes, f->fty.c_vararg);
     f->ir.type = new llvm::PATypeHolder(functype);
 
+#if 0
     Logger::cout() << "Final function type: " << *functype << "\n";
+#endif
 
     return functype;
 }
@@ -304,16 +306,6 @@
         return; // ignore declaration completely
     }
 
-    if (AggregateDeclaration* ad = fdecl->isMember())
-    {
-        ad->codegen(Type::sir);
-        if (ad->isStructDeclaration() && llvm::isa<llvm::OpaqueType>(DtoType(ad->type)))
-        {
-            ad->ir.irStruct->structFuncs.push_back(fdecl);
-            return;
-        }
-    }
-
     //printf("resolve function: %s\n", fdecl->toPrettyChars());
 
     if (fdecl->parent)
@@ -372,7 +364,6 @@
     // queue declaration unless the function is abstract without body
     if (!fdecl->isAbstract() || fdecl->fbody)
     {
-        Logger::println("Ignoring declaration of abstract bodyless function %s", fdecl->toPrettyChars());
         DtoDeclareFunction(fdecl);
     }
 }
@@ -465,6 +456,9 @@
     Type* t = fdecl->type->toBasetype();
     TypeFunction* f = (TypeFunction*)t;
 
+    // sanity check
+    assert(fdecl == f->funcdecl && "the function type does not point to this function");
+
     bool declareOnly = !mustDefineSymbol(fdecl);
 
     if (fdecl->llvmInternal == LLVMva_start)