Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Module::members -> Dsymbol::codegen to define symbols. #507

Merged
merged 12 commits into from
Oct 13, 2013
Merged
6 changes: 3 additions & 3 deletions dmd2/aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ struct StructDeclaration : AggregateDeclaration
StructDeclaration *isStructDeclaration() { return this; }

#if IN_LLVM
void codegen(Ir*);
void codegen(IRState*);
#endif
};

Expand Down Expand Up @@ -337,7 +337,7 @@ struct ClassDeclaration : AggregateDeclaration
ClassDeclaration *isClassDeclaration() { return (ClassDeclaration *)this; }

#if IN_LLVM
virtual void codegen(Ir*);
virtual void codegen(IRState*);
#endif
};

Expand Down Expand Up @@ -367,7 +367,7 @@ struct InterfaceDeclaration : ClassDeclaration
InterfaceDeclaration *isInterfaceDeclaration() { return this; }

#if IN_LLVM
void codegen(Ir*);
void codegen(IRState*);
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions dmd2/attrib.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct AttribDeclaration : Dsymbol
#endif

#if IN_LLVM
virtual void codegen(Ir*);
void codegen(IRState*);
#endif
};

Expand Down Expand Up @@ -161,7 +161,7 @@ struct PragmaDeclaration : AttribDeclaration
#endif

#if IN_LLVM
void codegen(Ir*);
void codegen(IRState*);
#endif
};

Expand Down
23 changes: 12 additions & 11 deletions dmd2/declaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ struct Declaration : Dsymbol
enum PROT prot();

Declaration *isDeclaration() { return this; }

#if IN_LLVM
/// Codegen traversal
virtual void codegen(Ir* ir);
#endif
};

/**************************************************************/
Expand All @@ -216,7 +211,7 @@ struct TupleDeclaration : Declaration
#if IN_LLVM
void semantic3(Scope *sc);
/// Codegen traversal
void codegen(Ir* ir);
void codegen(IRState* ir);
#endif
};

Expand Down Expand Up @@ -256,7 +251,7 @@ struct TypedefDeclaration : Declaration

#if IN_LLVM
/// Codegen traversal
void codegen(Ir* ir);
void codegen(IRState* ir);
#endif
};

Expand Down Expand Up @@ -362,7 +357,7 @@ struct VarDeclaration : Declaration

#if IN_LLVM
/// Codegen traversal
virtual void codegen(Ir* ir);
void codegen(IRState* ir);

/// Index into parent aggregate.
/// Set during type generation.
Expand Down Expand Up @@ -455,7 +450,7 @@ struct TypeInfoDeclaration : VarDeclaration

#if IN_LLVM
/// Codegen traversal
void codegen(Ir* ir);
void codegen(IRState* ir);
virtual void llvmDefine();
#endif
};
Expand Down Expand Up @@ -483,7 +478,11 @@ struct TypeInfoClassDeclaration : TypeInfoDeclaration
#endif

#if IN_LLVM
void codegen(Ir*);
// TypeInfoClassDeclaration instances are different; they describe
// __ClassZ/__InterfaceZ symbols instead of a TypeInfo_….init one. DMD also
// generates them for SomeInterface.classinfo access, so we can't just
// distinguish between them using tinfo and thus need to override codegen().
void codegen(IRState* ir);
void llvmDefine();
#endif
};
Expand Down Expand Up @@ -819,7 +818,9 @@ struct FuncDeclaration : Declaration
// functions
FuncDeclarations siblingCallers; // Sibling nested functions which
// called this one
#if IN_DMD
FuncDeclarations deferred; // toObjFile() these functions after this one
#endif

unsigned flags;
#define FUNCFLAGpurityInprocess 1 // working on determining purity
Expand Down Expand Up @@ -918,7 +919,7 @@ struct FuncDeclaration : Declaration
IrFuncTy irFty;

/// Codegen traversal
void codegen(Ir* ir);
void codegen(IRState* ir);

// vars declared in this function that nested funcs reference
// is this is not empty, nestedFrameRef is set and these VarDecls
Expand Down
4 changes: 2 additions & 2 deletions dmd2/dsymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct TYPE;
#endif

#if IN_LLVM
class Ir;
class IRState;
namespace llvm
{
class Value;
Expand Down Expand Up @@ -287,7 +287,7 @@ struct Dsymbol : Object
virtual ClassInfoDeclaration* isClassInfoDeclaration() { return NULL; }

/// Codegen traversal
virtual void codegen(Ir* ir);
virtual void codegen(IRState* p);

// llvm stuff
int llvmInternal;
Expand Down
2 changes: 1 addition & 1 deletion dmd2/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct EnumDeclaration : ScopeDsymbol
#endif

#if IN_LLVM
void codegen(Ir*);
void codegen(IRState*);
#endif
};

Expand Down
4 changes: 0 additions & 4 deletions dmd2/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -4735,11 +4735,7 @@ void UnitTestDeclaration::semantic(Scope *sc)
{ sc = scope;
scope = NULL;
}
#if IN_LLVM
if (global.params.useUnitTests && sc->module->isRoot)
#else
if (global.params.useUnitTests)
#endif
{
if (!type)
type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd);
Expand Down
202 changes: 0 additions & 202 deletions dmd2/irstate.c

This file was deleted.

Loading