view ir/ir.cpp @ 1354:701d11a1e7b1

Re-apply [1346], which was reverted in [1348], now that padding should no longer be a problem. As noted before, this will break ABI-compatibility on x86-64, so recompile old code before linking with newly-compiled code if you're on x86-64. As an added bonus, I actually tested it this time :).
author Frits van Bommel <fvbommel wxs.nl>
date Thu, 14 May 2009 20:40:56 +0200
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);
    }
}