Files
ldc/ir/ir.cpp
kai a11459bc31 "The Great Renaming" continues.
More changes to match the renamed files of LLVM 3.3.
2013-01-06 17:17:30 +01:00

65 lines
1.3 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//===-- ir.cpp ------------------------------------------------------------===//
//
// LDC the LLVM D compiler
//
// This file is distributed under the BSD-style LDC license. See the LICENSE
// file for details.
//
//===----------------------------------------------------------------------===//
#if LDC_LLVM_VER >= 303
#include "llvm/IR/DataLayout.h"
#elif LDC_LLVM_VER == 302
#include "llvm/DataLayout.h"
#else
#include "llvm/Target/TargetData.h"
#endif
#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 gDataLayout->getABITypeAlignment(DtoType(t));
}
unsigned GetPointerSize(Ir* ir)
{
return gDataLayout->getPointerSize(ADDRESS_SPACE);
}
unsigned GetTypeStoreSize(Ir* ir, Type* t)
{
return gDataLayout->getTypeStoreSize(DtoType(t));
}
unsigned GetTypeAllocSize(Ir* ir, Type* t)
{
return gDataLayout->getTypeAllocSize(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);
}
}