diff options
author | Tom Stellard <[email protected]> | 2012-10-10 21:00:13 +0000 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-10-11 21:33:00 +0000 |
commit | 4cc530f452436a5304a628d1428ed7f07247a175 (patch) | |
tree | d13367952d246f295fe027d84bfbe922534332b9 | |
parent | dc54c49df9c9e37b00d3ba20455407999e03f391 (diff) |
radeon/llvm: Fix build with LLVM 3.2
-rw-r--r-- | src/gallium/drivers/radeon/radeon_llvm_emit.cpp | 13 |
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); |