Skip to content

Commit

Permalink
Added missing new files.
Browse files Browse the repository at this point in the history
  • Loading branch information
lindquist committed Mar 27, 2009
1 parent be3bfbf commit 06a2934
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ir/ir.cpp
@@ -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);
}
}
1 change: 1 addition & 0 deletions ir/irsymbol.cpp
@@ -0,0 +1 @@
#include "ir/irsymbol.h"
20 changes: 20 additions & 0 deletions ir/irsymbol.h
@@ -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

0 comments on commit 06a2934

Please sign in to comment.