view ir/ir.cpp @ 1599:0a4be54234d6

Revert fix by Robert for downs as it causes a segfault when compiling tango.
author Kelly Wilson <wilsonk cpsc.ucalgary.ca>
date Wed, 23 Dec 2009 22:49:20 -0700
parents 2a687353c84d
children
line wrap: on
line source

#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);
    }
}