Mercurial > projects > ldc
changeset 1150:2a687353c84d
Added missing new files.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Fri, 27 Mar 2009 23:24:47 +0100 |
parents | 5ebe8224988b |
children | 3cf0066e6faf |
files | ir/ir.cpp ir/irsymbol.cpp ir/irsymbol.h |
diffstat | 3 files changed, 55 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ir/ir.cpp Fri Mar 27 23:24:47 2009 +0100 @@ -0,0 +1,34 @@ +#include "llvm/Target/TargetData.h" + +#include "gen/irstate.h" +#include "gen/tollvm.h" +#include "gen/functions.h" + +#include "ir/ir.h" +#include "ir/irfunction.h" + + +unsigned GetTypeAlignment(Ir* ir, Type* t) +{ + return gTargetData->getABITypeAlignment(DtoType(t)); +} + +Ir::Ir() +: irs(NULL) +{ +} + +void Ir::addFunctionBody(IrFunction * f) +{ + functionbodies.push_back(f); +} + +void Ir::emitFunctionBodies() +{ + while (!functionbodies.empty()) + { + IrFunction* irf = functionbodies.front(); + functionbodies.pop_front(); + DtoDefineFunction(irf->decl); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ir/irsymbol.cpp Fri Mar 27 23:24:47 2009 +0100 @@ -0,0 +1,1 @@ +#include "ir/irsymbol.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ir/irsymbol.h Fri Mar 27 23:24:47 2009 +0100 @@ -0,0 +1,20 @@ +#ifndef __LDC_IR_IRSYMBOL_H__ +#define __LDC_IR_IRSYMBOL_H__ + +#include "ir/ir.h" + +/// Base class for all symbols. +struct IrSymbol +{ + /// + IrSymbol(Ir* ir) : ir(ir) {} + + /// Migrate symbols to current module if necessary. + virtual void migrate() = 0; + +protected: + /// + Ir* ir; +}; + +#endif