Added back a bunch of static's to gen/classes.cpp, it's not superfluous, it makes the functions internal to the compilation unit, and we don't call them anywhere else.

This commit is contained in:
Tomas Lindquist Olsen 2008-12-09 02:07:24 +01:00
parent b6781a8eae
commit a2bf0796ce

View file

@ -22,7 +22,7 @@
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// adds the base interfaces of b and the given iri to IrStruct's interfaceMap // adds the base interfaces of b and the given iri to IrStruct's interfaceMap
void add_base_interfaces(IrStruct* to, IrInterface* iri, BaseClass* b) static void add_base_interfaces(IrStruct* to, IrInterface* iri, BaseClass* b)
{ {
for (unsigned j = 0; j < b->baseInterfaces_dim; j++) for (unsigned j = 0; j < b->baseInterfaces_dim; j++)
{ {
@ -39,7 +39,7 @@ void add_base_interfaces(IrStruct* to, IrInterface* iri, BaseClass* b)
// adds interface b to target, if newinstance != 0, then target must provide all // adds interface b to target, if newinstance != 0, then target must provide all
// functions required to implement b (it reimplements b) // functions required to implement b (it reimplements b)
void add_interface(ClassDeclaration* target, BaseClass* b, int newinstance) static void add_interface(ClassDeclaration* target, BaseClass* b, int newinstance)
{ {
Logger::println("adding interface: %s", b->base->toChars()); Logger::println("adding interface: %s", b->base->toChars());
LOG_SCOPE; LOG_SCOPE;
@ -90,7 +90,7 @@ void add_interface(ClassDeclaration* target, BaseClass* b, int newinstance)
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
void add_class_data(ClassDeclaration* target, ClassDeclaration* cd) static void add_class_data(ClassDeclaration* target, ClassDeclaration* cd)
{ {
Logger::println("Adding data from class: %s", cd->toChars()); Logger::println("Adding data from class: %s", cd->toChars());
LOG_SCOPE; LOG_SCOPE;
@ -125,7 +125,7 @@ void add_class_data(ClassDeclaration* target, ClassDeclaration* cd)
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
void DtoResolveInterface(InterfaceDeclaration* cd) static void DtoResolveInterface(InterfaceDeclaration* cd)
{ {
if (cd->ir.resolved) return; if (cd->ir.resolved) return;
cd->ir.resolved = true; cd->ir.resolved = true;
@ -275,7 +275,7 @@ void DtoResolveClass(ClassDeclaration* cd)
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
void DtoDeclareInterface(InterfaceDeclaration* cd) static void DtoDeclareInterface(InterfaceDeclaration* cd)
{ {
if (cd->ir.declared) return; if (cd->ir.declared) return;
cd->ir.declared = true; cd->ir.declared = true;
@ -440,7 +440,7 @@ void DtoDeclareClass(ClassDeclaration* cd)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// adds data fields and interface vtables to the constant initializer of class cd // adds data fields and interface vtables to the constant initializer of class cd
size_t init_class_initializer(std::vector<LLConstant*>& inits, ClassDeclaration* target, ClassDeclaration* cd, size_t offsetbegin) static size_t init_class_initializer(std::vector<LLConstant*>& inits, ClassDeclaration* target, ClassDeclaration* cd, size_t offsetbegin)
{ {
// first do baseclasses // first do baseclasses
if (cd->baseClass) if (cd->baseClass)
@ -543,7 +543,7 @@ size_t init_class_initializer(std::vector<LLConstant*>& inits, ClassDeclaration*
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// build the vtable initializer for class cd // build the vtable initializer for class cd
void init_class_vtbl_initializer(ClassDeclaration* cd) static void init_class_vtbl_initializer(ClassDeclaration* cd)
{ {
// generate vtable initializer // generate vtable initializer
std::vector<LLConstant*> sinits(cd->vtbl.dim, NULL); std::vector<LLConstant*> sinits(cd->vtbl.dim, NULL);
@ -596,7 +596,7 @@ void init_class_vtbl_initializer(ClassDeclaration* cd)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
void init_class_interface_vtbl_initializers(ClassDeclaration* cd) static void init_class_interface_vtbl_initializers(ClassDeclaration* cd)
{ {
IrStruct* irstruct = cd->ir.irStruct; IrStruct* irstruct = cd->ir.irStruct;
@ -697,7 +697,7 @@ void init_class_interface_vtbl_initializers(ClassDeclaration* cd)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
void DtoConstInitInterface(InterfaceDeclaration* cd) static void DtoConstInitInterface(InterfaceDeclaration* cd)
{ {
if (cd->ir.initialized) return; if (cd->ir.initialized) return;
cd->ir.initialized = true; cd->ir.initialized = true;
@ -780,7 +780,7 @@ void DtoConstInitClass(ClassDeclaration* cd)
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
void DefineInterfaceInfos(IrStruct* irstruct) static void DefineInterfaceInfos(IrStruct* irstruct)
{ {
// always do interface info array when possible // always do interface info array when possible
std::vector<LLConstant*> infoInits; std::vector<LLConstant*> infoInits;
@ -810,7 +810,7 @@ void DefineInterfaceInfos(IrStruct* irstruct)
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
void DtoDefineInterface(InterfaceDeclaration* cd) static void DtoDefineInterface(InterfaceDeclaration* cd)
{ {
if (cd->ir.defined) return; if (cd->ir.defined) return;
cd->ir.defined = true; cd->ir.defined = true;
@ -1323,7 +1323,7 @@ void DtoDeclareClassInfo(ClassDeclaration* cd)
#if GENERATE_OFFTI #if GENERATE_OFFTI
// build a single element for the OffsetInfo[] of ClassInfo // build a single element for the OffsetInfo[] of ClassInfo
LLConstant* build_offti_entry(ClassDeclaration* cd, VarDeclaration* vd) static LLConstant* build_offti_entry(ClassDeclaration* cd, VarDeclaration* vd)
{ {
std::vector<LLConstant*> inits(2); std::vector<LLConstant*> inits(2);
@ -1348,7 +1348,7 @@ LLConstant* build_offti_entry(ClassDeclaration* cd, VarDeclaration* vd)
return llvm::ConstantStruct::get(inits); return llvm::ConstantStruct::get(inits);
} }
LLConstant* build_offti_array(ClassDeclaration* cd, const LLType* arrayT) static LLConstant* build_offti_array(ClassDeclaration* cd, const LLType* arrayT)
{ {
IrStruct* irstruct = cd->ir.irStruct; IrStruct* irstruct = cd->ir.irStruct;
@ -1383,7 +1383,7 @@ LLConstant* build_offti_array(ClassDeclaration* cd, const LLType* arrayT)
#endif // GENERATE_OFFTI #endif // GENERATE_OFFTI
LLConstant* build_class_dtor(ClassDeclaration* cd) static LLConstant* build_class_dtor(ClassDeclaration* cd)
{ {
FuncDeclaration* dtor = cd->dtor; FuncDeclaration* dtor = cd->dtor;
@ -1395,7 +1395,7 @@ LLConstant* build_class_dtor(ClassDeclaration* cd)
return llvm::ConstantExpr::getBitCast(dtor->ir.irFunc->func, getPtrToType(LLType::Int8Ty)); return llvm::ConstantExpr::getBitCast(dtor->ir.irFunc->func, getPtrToType(LLType::Int8Ty));
} }
unsigned build_classinfo_flags(ClassDeclaration* cd) static unsigned build_classinfo_flags(ClassDeclaration* cd)
{ {
// adapted from original dmd code // adapted from original dmd code
unsigned flags = 0; unsigned flags = 0;