Skip to content

Commit

Permalink
Renamed !TypeInfoBuilder to !RTTIBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
lindquist committed May 17, 2009
1 parent 0414a5a commit b6daf3d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
28 changes: 14 additions & 14 deletions gen/rttibuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "ir/irstruct.h"

TypeInfoBuilder::TypeInfoBuilder(ClassDeclaration* base_class)
RTTIBuilder::RTTIBuilder(ClassDeclaration* base_class)
{
// make sure the base typeinfo class has been processed
base_class->codegen(Type::sir);
Expand All @@ -29,46 +29,46 @@ TypeInfoBuilder::TypeInfoBuilder(ClassDeclaration* base_class)
push_null_vp();
}

void TypeInfoBuilder::push(llvm::Constant* C)
void RTTIBuilder::push(llvm::Constant* C)
{
inits.push_back(C);
}

void TypeInfoBuilder::push_null_vp()
void RTTIBuilder::push_null_vp()
{
inits.push_back(getNullValue(getVoidPtrType()));
}

void TypeInfoBuilder::push_typeinfo(Type* t)
void RTTIBuilder::push_typeinfo(Type* t)
{
inits.push_back(DtoTypeInfoOf(t, true));
}

void TypeInfoBuilder::push_classinfo(ClassDeclaration* cd)
void RTTIBuilder::push_classinfo(ClassDeclaration* cd)
{
inits.push_back(cd->ir.irStruct->getClassInfoSymbol());
}

void TypeInfoBuilder::push_string(const char* str)
void RTTIBuilder::push_string(const char* str)
{
inits.push_back(DtoConstString(str));
}

void TypeInfoBuilder::push_null_void_array()
void RTTIBuilder::push_null_void_array()
{
const llvm::Type* T = DtoType(Type::tvoid->arrayOf());
inits.push_back(getNullValue(T));
}

void TypeInfoBuilder::push_void_array(uint64_t dim, llvm::Constant* ptr)
void RTTIBuilder::push_void_array(uint64_t dim, llvm::Constant* ptr)
{
inits.push_back(DtoConstSlice(
DtoConstSize_t(dim),
DtoBitCast(ptr, getVoidPtrType())
));
}

void TypeInfoBuilder::push_void_array(llvm::Constant* CI, Type* valtype, Dsymbol* mangle_sym)
void RTTIBuilder::push_void_array(llvm::Constant* CI, Type* valtype, Dsymbol* mangle_sym)
{
std::string initname(mangle_sym->mangle());
initname.append(".rtti.void[].data");
Expand All @@ -83,7 +83,7 @@ void TypeInfoBuilder::push_void_array(llvm::Constant* CI, Type* valtype, Dsymbol
push_void_array(dim, G);
}

void TypeInfoBuilder::push_array(llvm::Constant * CI, uint64_t dim, Type* valtype, Dsymbol * mangle_sym)
void RTTIBuilder::push_array(llvm::Constant * CI, uint64_t dim, Type* valtype, Dsymbol * mangle_sym)
{
std::string initname(mangle_sym?mangle_sym->mangle():".ldc");
initname.append(".rtti.");
Expand All @@ -100,17 +100,17 @@ void TypeInfoBuilder::push_array(llvm::Constant * CI, uint64_t dim, Type* valtyp
));
}

void TypeInfoBuilder::push_uint(unsigned u)
void RTTIBuilder::push_uint(unsigned u)
{
inits.push_back(DtoConstUint(u));
}

void TypeInfoBuilder::push_size(uint64_t s)
void RTTIBuilder::push_size(uint64_t s)
{
inits.push_back(DtoConstSize_t(s));
}

void TypeInfoBuilder::push_funcptr(FuncDeclaration* fd)
void RTTIBuilder::push_funcptr(FuncDeclaration* fd)
{
if (fd)
{
Expand All @@ -124,7 +124,7 @@ void TypeInfoBuilder::push_funcptr(FuncDeclaration* fd)
}
}

void TypeInfoBuilder::finalize(IrGlobal* tid)
void RTTIBuilder::finalize(IrGlobal* tid)
{
// create the inititalizer
LLConstant* tiInit = llvm::ConstantStruct::get(&inits[0], inits.size(), false);
Expand Down
4 changes: 2 additions & 2 deletions gen/rttibuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct Type;

struct IrStruct;

struct TypeInfoBuilder
struct RTTIBuilder
{
ClassDeclaration* base;
TypeClass* basetype;
Expand All @@ -19,7 +19,7 @@ struct TypeInfoBuilder
// 10 is enough for any D1 typeinfo
llvm::SmallVector<llvm::Constant*, 10> inits;

TypeInfoBuilder(ClassDeclaration* base_class);
RTTIBuilder(ClassDeclaration* base_class);

void push(llvm::Constant* C);
void push_null_vp();
Expand Down
28 changes: 14 additions & 14 deletions gen/typinf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void TypeInfoTypedefDeclaration::llvmDefine()
Logger::println("TypeInfoTypedefDeclaration::llvmDefine() %s", toChars());
LOG_SCOPE;

TypeInfoBuilder b(Type::typeinfotypedef);
RTTIBuilder b(Type::typeinfotypedef);

assert(tinfo->ty == Ttypedef);
TypeTypedef *tc = (TypeTypedef *)tinfo;
Expand Down Expand Up @@ -411,7 +411,7 @@ void TypeInfoEnumDeclaration::llvmDefine()
Logger::println("TypeInfoEnumDeclaration::llvmDefine() %s", toChars());
LOG_SCOPE;

TypeInfoBuilder b(Type::typeinfoenum);
RTTIBuilder b(Type::typeinfoenum);

assert(tinfo->ty == Tenum);
TypeEnum *tc = (TypeEnum *)tinfo;
Expand Down Expand Up @@ -449,7 +449,7 @@ void TypeInfoPointerDeclaration::llvmDefine()
Logger::println("TypeInfoPointerDeclaration::llvmDefine() %s", toChars());
LOG_SCOPE;

TypeInfoBuilder b(Type::typeinfopointer);
RTTIBuilder b(Type::typeinfopointer);
// TypeInfo base
b.push_typeinfo(tinfo->nextOf());
// finish
Expand All @@ -463,7 +463,7 @@ void TypeInfoArrayDeclaration::llvmDefine()
Logger::println("TypeInfoArrayDeclaration::llvmDefine() %s", toChars());
LOG_SCOPE;

TypeInfoBuilder b(Type::typeinfoarray);
RTTIBuilder b(Type::typeinfoarray);
// TypeInfo base
b.push_typeinfo(tinfo->nextOf());
// finish
Expand All @@ -480,7 +480,7 @@ void TypeInfoStaticArrayDeclaration::llvmDefine()
assert(tinfo->ty == Tsarray);
TypeSArray *tc = (TypeSArray *)tinfo;

TypeInfoBuilder b(Type::typeinfostaticarray);
RTTIBuilder b(Type::typeinfostaticarray);

// value typeinfo
b.push_typeinfo(tc->nextOf());
Expand All @@ -502,7 +502,7 @@ void TypeInfoAssociativeArrayDeclaration::llvmDefine()
assert(tinfo->ty == Taarray);
TypeAArray *tc = (TypeAArray *)tinfo;

TypeInfoBuilder b(Type::typeinfoassociativearray);
RTTIBuilder b(Type::typeinfoassociativearray);

// value typeinfo
b.push_typeinfo(tc->nextOf());
Expand All @@ -521,7 +521,7 @@ void TypeInfoFunctionDeclaration::llvmDefine()
Logger::println("TypeInfoFunctionDeclaration::llvmDefine() %s", toChars());
LOG_SCOPE;

TypeInfoBuilder b(Type::typeinfofunction);
RTTIBuilder b(Type::typeinfofunction);
// TypeInfo base
b.push_typeinfo(tinfo->nextOf());
// finish
Expand All @@ -538,7 +538,7 @@ void TypeInfoDelegateDeclaration::llvmDefine()
assert(tinfo->ty == Tdelegate);
Type* ret_type = tinfo->nextOf()->nextOf();

TypeInfoBuilder b(Type::typeinfodelegate);
RTTIBuilder b(Type::typeinfodelegate);
// TypeInfo base
b.push_typeinfo(ret_type);
// finish
Expand Down Expand Up @@ -582,7 +582,7 @@ void TypeInfoStructDeclaration::llvmDefine()
sd->codegen(Type::sir);
IrStruct* irstruct = sd->ir.irStruct;

TypeInfoBuilder b(Type::typeinfostruct);
RTTIBuilder b(Type::typeinfostruct);

// char[] name
b.push_string(sd->toPrettyChars());
Expand Down Expand Up @@ -670,7 +670,7 @@ void TypeInfoClassDeclaration::llvmDefine()
TypeClass *tc = (TypeClass *)tinfo;
tc->sym->codegen(Type::sir);

TypeInfoBuilder b(Type::typeinfoclass);
RTTIBuilder b(Type::typeinfoclass);

// TypeInfo base
b.push_classinfo(tc->sym);
Expand All @@ -691,7 +691,7 @@ void TypeInfoInterfaceDeclaration::llvmDefine()
TypeClass *tc = (TypeClass *)tinfo;
tc->sym->codegen(Type::sir);

TypeInfoBuilder b(Type::typeinfointerface);
RTTIBuilder b(Type::typeinfointerface);

// TypeInfo base
b.push_classinfo(tc->sym);
Expand Down Expand Up @@ -727,7 +727,7 @@ void TypeInfoTupleDeclaration::llvmDefine()
const LLArrayType* arrTy = LLArrayType::get(tiTy, dim);
LLConstant* arrC = llvm::ConstantArray::get(arrTy, arrInits);

TypeInfoBuilder b(Type::typeinfotypelist);
RTTIBuilder b(Type::typeinfotypelist);

// push TypeInfo[]
b.push_array(arrC, dim, Type::typeinfo->type, NULL);
Expand All @@ -745,7 +745,7 @@ void TypeInfoConstDeclaration::llvmDefine()
Logger::println("TypeInfoConstDeclaration::llvmDefine() %s", toChars());
LOG_SCOPE;

TypeInfoBuilder b(Type::typeinfoconst);
RTTIBuilder b(Type::typeinfoconst);
// TypeInfo base
b.push_typeinfo(tinfo->mutableOf()->merge());
// finish
Expand All @@ -759,7 +759,7 @@ void TypeInfoInvariantDeclaration::llvmDefine()
Logger::println("TypeInfoInvariantDeclaration::llvmDefine() %s", toChars());
LOG_SCOPE;

TypeInfoBuilder b(Type::typeinfoinvariant);
RTTIBuilder b(Type::typeinfoinvariant);
// TypeInfo base
b.push_typeinfo(tinfo->mutableOf()->merge());
// finish
Expand Down

0 comments on commit b6daf3d

Please sign in to comment.