Added CMake option to disable generation of ClassInfo.offTi arrays, defaults to OFF.

This commit is contained in:
Tomas Lindquist Olsen
2008-12-02 01:44:17 +01:00
parent 91a2c257b0
commit 879bed7df6
3 changed files with 22 additions and 3 deletions

View File

@@ -1312,6 +1312,8 @@ void DtoDeclareClassInfo(ClassDeclaration* cd)
//////////////////////////////////////////////////////////////////////////////////////////
#if GENERATE_OFFTI
// build a single element for the OffsetInfo[] of ClassInfo
static LLConstant* build_offti_entry(ClassDeclaration* cd, VarDeclaration* vd)
{
@@ -1371,6 +1373,8 @@ static LLConstant* build_offti_array(ClassDeclaration* cd, const LLType* arrayT)
return DtoConstSlice(size, ptr);
}
#endif // GENERATE_OFFTI
static LLConstant* build_class_dtor(ClassDeclaration* cd)
{
FuncDeclaration* dtor = cd->dtor;
@@ -1581,10 +1585,20 @@ void DtoDefineClassInfo(ClassDeclaration* cd)
// offset typeinfo
VarDeclaration* offTiVar = (VarDeclaration*)cinfo->fields.data[9];
const LLType* offTiTy = DtoType(offTiVar->type);
#if GENERATE_OFFTI
if (cd->isInterfaceDeclaration())
c = LLConstant::getNullValue(offTiTy);
else
c = build_offti_array(cd, offTiTy);
#else // GENERATE_OFFTI
c = LLConstant::getNullValue(offTiTy);
#endif // GENERATE_OFFTI
inits.push_back(c);
// default constructor
@@ -1606,8 +1620,6 @@ void DtoDefineClassInfo(ClassDeclaration* cd)
// FIXME: fill it out!
inits.push_back( LLConstant::getNullValue(xgetTy) );
#else
#endif
/*size_t n = inits.size();