mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-17 19:07:05 +02:00
Add address space number to getPointerSize() calls.
This is required for LLVM 3.2.
This commit is contained in:
+1
-1
@@ -581,7 +581,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
global.params.isLE = gDataLayout->isLittleEndian();
|
global.params.isLE = gDataLayout->isLittleEndian();
|
||||||
// Starting with LLVM 3.1 we could also use global.params.targetTriple.isArch64Bit();
|
// Starting with LLVM 3.1 we could also use global.params.targetTriple.isArch64Bit();
|
||||||
global.params.is64bit = gDataLayout->getPointerSizeInBits() == 64;
|
global.params.is64bit = gDataLayout->getPointerSizeInBits(ADDRESS_SPACE) == 64;
|
||||||
global.params.cpu = static_cast<ARCH>(global.params.targetTriple.getArch());
|
global.params.cpu = static_cast<ARCH>(global.params.targetTriple.getArch());
|
||||||
global.params.os = static_cast<OS>(global.params.targetTriple.getOS());
|
global.params.os = static_cast<OS>(global.params.targetTriple.getOS());
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,10 @@ namespace llvm {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LDC_LLVM_VER >= 302
|
#if LDC_LLVM_VER >= 302
|
||||||
|
#define ADDRESS_SPACE 0
|
||||||
#define HAS_ATTRIBUTES(x) (x).hasAttributes()
|
#define HAS_ATTRIBUTES(x) (x).hasAttributes()
|
||||||
#else
|
#else
|
||||||
|
#define ADDRESS_SPACE
|
||||||
#define HAS_ATTRIBUTES(x) (x)
|
#define HAS_ATTRIBUTES(x) (x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ unsigned GetTypeAlignment(Ir* ir, Type* t)
|
|||||||
|
|
||||||
unsigned GetPointerSize(Ir* ir)
|
unsigned GetPointerSize(Ir* ir)
|
||||||
{
|
{
|
||||||
return gDataLayout->getPointerSize();
|
return gDataLayout->getPointerSize(ADDRESS_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GetTypeStoreSize(Ir* ir, Type* t)
|
unsigned GetTypeStoreSize(Ir* ir, Type* t)
|
||||||
|
|||||||
Reference in New Issue
Block a user