Added Doxygen file.

Completely seperated type and symbol generation. Should fix a lot of bugs, but is not yet 100% complete.
This commit is contained in:
Tomas Lindquist Olsen
2009-04-15 20:06:25 +02:00
parent 909c6dae18
commit 37cf5a5789
33 changed files with 3158 additions and 2201 deletions

View File

@@ -201,7 +201,9 @@ const llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nest
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 @@ void DtoResolveFunction(FuncDeclaration* fdecl)
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 @@ void DtoResolveFunction(FuncDeclaration* fdecl)
// 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 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
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)