summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/radeon')
-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);