Use TargetData to get size of certain types (instead of hard-coded values).

This commit is contained in:
kai
2012-08-25 01:29:42 +02:00
parent 2173b52aea
commit 1205e3ea83
2 changed files with 41 additions and 19 deletions

View File

@@ -13,6 +13,21 @@ unsigned GetTypeAlignment(Ir* ir, Type* t)
return gTargetData->getABITypeAlignment(DtoType(t));
}
unsigned GetPointerSize(Ir* ir)
{
return gTargetData->getPointerSize();
}
unsigned GetTypeStoreSize(Ir* ir, Type* t)
{
return gTargetData->getTypeStoreSize(DtoType(t));
}
unsigned GetTypeAllocSize(Ir* ir, Type* t)
{
return gTargetData->getTypeAllocSize(DtoType(t));
}
Ir::Ir()
: irs(NULL)
{