mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 10:53:14 +01:00
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:
@@ -22,7 +22,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 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++)
|
||||
{
|
||||
@@ -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
|
||||
// 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());
|
||||
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());
|
||||
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;
|
||||
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;
|
||||
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
|
||||
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
|
||||
if (cd->baseClass)
|
||||
@@ -543,7 +543,7 @@ size_t init_class_initializer(std::vector<LLConstant*>& inits, ClassDeclaration*
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 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
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
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
|
||||
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;
|
||||
cd->ir.defined = true;
|
||||
@@ -1323,7 +1323,7 @@ void DtoDeclareClassInfo(ClassDeclaration* cd)
|
||||
#if GENERATE_OFFTI
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -1348,7 +1348,7 @@ LLConstant* build_offti_entry(ClassDeclaration* cd, VarDeclaration* vd)
|
||||
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;
|
||||
|
||||
@@ -1383,7 +1383,7 @@ LLConstant* build_offti_array(ClassDeclaration* cd, const LLType* arrayT)
|
||||
|
||||
#endif // GENERATE_OFFTI
|
||||
|
||||
LLConstant* build_class_dtor(ClassDeclaration* cd)
|
||||
static LLConstant* build_class_dtor(ClassDeclaration* cd)
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
unsigned build_classinfo_flags(ClassDeclaration* cd)
|
||||
static unsigned build_classinfo_flags(ClassDeclaration* cd)
|
||||
{
|
||||
// adapted from original dmd code
|
||||
unsigned flags = 0;
|
||||
|
||||
Reference in New Issue
Block a user