* simple, or constant propagation into them, etc.
*/
+#if HAVE_LLVM < 0x0309
// Old versions of LLVM get the DataLayout from the pass manager.
LLVMAddTargetData(gallivm->target, gallivm->passmgr);
+#endif
/* Setting the module's DataLayout to an empty string will cause the
* ExecutionEngine to copy to the DataLayout string from its target
static void radeon_llvm_optimize(LLVMModuleRef mod)
{
+#if HAVE_LLVM < 0x0309
const char *data_layout = LLVMGetDataLayout(mod);
LLVMTargetDataRef TD = LLVMCreateTargetData(data_layout);
+#endif
LLVMPassManagerBuilderRef builder = LLVMPassManagerBuilderCreate();
LLVMPassManagerRef pass_manager = LLVMCreatePassManager();
}
}
+#if HAVE_LLVM < 0x0309
LLVMAddTargetData(TD, pass_manager);
+#endif
LLVMAddAlwaysInlinerPass(pass_manager);
LLVMPassManagerBuilderPopulateModulePassManager(builder, pass_manager);
LLVMRunPassManager(pass_manager, mod);
LLVMPassManagerBuilderDispose(builder);
LLVMDisposePassManager(pass_manager);
+#if HAVE_LLVM < 0x0309
LLVMDisposeTargetData(TD);
+#endif
}
LLVMModuleRef radeon_llvm_get_kernel_module(LLVMContextRef ctx, unsigned index,