summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-10-10 21:00:13 +0000
committerTom Stellard <[email protected]>2012-10-11 21:33:00 +0000
commit4cc530f452436a5304a628d1428ed7f07247a175 (patch)
treed13367952d246f295fe027d84bfbe922534332b9 /src/gallium/drivers
parentdc54c49df9c9e37b00d3ba20455407999e03f391 (diff)
radeon/llvm: Fix build with LLVM 3.2
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeon/radeon_llvm_emit.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
index 2f2eb4cb48e..21661a05002 100644
--- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
@@ -36,13 +36,16 @@
#include <llvm/Support/TargetRegistry.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/Support/Threading.h>
-#include <llvm/Target/TargetData.h>
#include <llvm/Target/TargetMachine.h>
-
#include <llvm/Transforms/Scalar.h>
-
#include <llvm-c/Target.h>
+#if HAVE_LLVM < 0x0302
+#include <llvm/Target/TargetData.h>
+#else
+#include <llvm/DataLayout.h>
+#endif
+
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
@@ -120,7 +123,11 @@ radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes,
));
TargetMachine &AMDGPUTargetMachine = *tm.get();
PassManager PM;
+#if HAVE_LLVM < 0x0302
PM.add(new TargetData(*AMDGPUTargetMachine.getTargetData()));
+#else
+ PM.add(new DataLayout(*AMDGPUTargetMachine.getDataLayout()));
+#endif
PM.add(createPromoteMemoryToRegisterPass());
AMDGPUTargetMachine.setAsmVerbosityDefault(true);