Add changes for LLVM 3.2

- The Attributes class was changed again
- TargetData was renamed to DataLayout

Compiles again with LLVm 3.0, 3.1 and trunk(3.2).
This commit is contained in:
kai 2012-10-13 18:54:42 +02:00
parent d523be3010
commit a7c7b514c0
23 changed files with 267 additions and 29 deletions

View file

@ -1114,7 +1114,7 @@ void DtoVarDeclaration(VarDeclaration* vd)
LLType* lltype = DtoType(type);
llvm::Value* allocainst;
if(gTargetData->getTypeSizeInBits(lltype) == 0)
if(gDataLayout->getTypeSizeInBits(lltype) == 0)
allocainst = llvm::ConstantPointerNull::get(getPtrToType(lltype));
else
allocainst = DtoAlloca(type, vd->toChars());
@ -1595,7 +1595,7 @@ void DtoOverloadedIntrinsicName(TemplateInstance* ti, TemplateDeclaration* td, s
}
char tmp[21]; // probably excessive, but covers a uint64_t
sprintf(tmp, "%lu", static_cast<unsigned long>(gTargetData->getTypeSizeInBits(DtoType(T))));
sprintf(tmp, "%lu", static_cast<unsigned long>(gDataLayout->getTypeSizeInBits(DtoType(T))));
// replace # in name with bitsize
name = td->intrinsicName;
@ -1770,7 +1770,7 @@ size_t realignOffset(size_t offset, Type* type)
}
// then we check against the llvm alignment
size_t alignsize2 = gTargetData->getABITypeAlignment(T);
size_t alignsize2 = gDataLayout->getABITypeAlignment(T);
// if it differs we need to insert manual padding as well
if (alignsize != alignsize2)