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

@@ -253,20 +253,6 @@ int TypeDArray::builtinTypeInfo()
/* ========================================================================= */
/***************************************
* Create a static array of TypeInfo references
* corresponding to an array of Expression's.
* Used to supply hidden _arguments[] value for variadic D functions.
*/
Expression *createTypeInfoArray(Scope *sc, Expression *exps[], int dim)
{
assert(0); // done elsewhere in LDC
return NULL;
}
/* ========================================================================= */
//////////////////////////////////////////////////////////////////////////////
// MAGIC PLACE
//////////////////////////////////////////////////////////////////////////////
@@ -376,7 +362,7 @@ void TypeInfoTypedefDeclaration::llvmDefine()
// vtbl
std::vector<LLConstant*> sinits;
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(getNullPtr(getPtrToType(LLType::Int8Ty)));
@@ -433,7 +419,7 @@ void TypeInfoEnumDeclaration::llvmDefine()
// vtbl
std::vector<LLConstant*> sinits;
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
@@ -491,7 +477,7 @@ static void LLVM_D_Define_TypeInfoBase(Type* basetype, TypeInfoDeclaration* tid,
// vtbl
std::vector<LLConstant*> sinits;
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
@@ -553,7 +539,7 @@ void TypeInfoStaticArrayDeclaration::llvmDefine()
// initializer vector
std::vector<LLConstant*> sinits;
// first is always the vtable
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
@@ -592,7 +578,7 @@ void TypeInfoAssociativeArrayDeclaration::llvmDefine()
// initializer vector
std::vector<LLConstant*> sinits;
// first is always the vtable
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
@@ -664,7 +650,7 @@ void TypeInfoStructDeclaration::llvmDefine()
// vtbl
std::vector<LLConstant*> sinits;
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
@@ -687,7 +673,7 @@ void TypeInfoStructDeclaration::llvmDefine()
#endif
{
size_t cisize = getTypeStoreSize(tc->ir.type->get());
LLConstant* cicast = llvm::ConstantExpr::getBitCast(sd->ir.irStruct->init, initpt);
LLConstant* cicast = llvm::ConstantExpr::getBitCast(sd->ir.irStruct->getInitSymbol(), initpt);
sinits.push_back(DtoConstSlice(DtoConstSize_t(cisize), cicast));
}
@@ -857,7 +843,7 @@ void TypeInfoClassDeclaration::llvmDefine()
// initializer vector
std::vector<LLConstant*> sinits;
// first is always the vtable
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
@@ -865,9 +851,10 @@ void TypeInfoClassDeclaration::llvmDefine()
// get classinfo
assert(tinfo->ty == Tclass);
TypeClass *tc = (TypeClass *)tinfo;
tc->sym->codegen(Type::sir);;
assert(tc->sym->ir.irStruct->classInfo);
sinits.push_back(tc->sym->ir.irStruct->classInfo);
tc->sym->codegen(Type::sir);
sinits.push_back(tc->sym->ir.irStruct->getClassInfoSymbol());
// create the inititalizer
LLConstant* tiInit = llvm::ConstantStruct::get(sinits);
@@ -897,7 +884,7 @@ void TypeInfoInterfaceDeclaration::llvmDefine()
// initializer vector
std::vector<LLConstant*> sinits;
// first is always the vtable
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
@@ -905,8 +892,8 @@ void TypeInfoInterfaceDeclaration::llvmDefine()
// get classinfo
assert(tinfo->ty == Tclass);
TypeClass *tc = (TypeClass *)tinfo;
assert(tc->sym->ir.irStruct->classInfo);
sinits.push_back(tc->sym->ir.irStruct->classInfo);
sinits.push_back(tc->sym->ir.irStruct->getClassInfoSymbol());
// create the inititalizer
LLConstant* tiInit = llvm::ConstantStruct::get(sinits);
@@ -936,7 +923,7 @@ void TypeInfoTupleDeclaration::llvmDefine()
// initializer vector
std::vector<LLConstant*> sinits;
// first is always the vtable
sinits.push_back(base->ir.irStruct->vtbl);
sinits.push_back(base->ir.irStruct->getVtblSymbol());
// monitor
sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));