elif with_gallium_opencl or with_gallium_r600
_llvm_version = '>= 3.9.0'
else
- _llvm_version = '>= 3.6.0'
+ _llvm_version = '>= 3.7.0'
endif
_shared_llvm = get_option('shared-llvm')
import SCons.Util
-required_llvm_version = '3.6'
+required_llvm_version = '3.7'
def generate(env):
'LLVMSupport',
'LLVMIRReader', 'LLVMASMParser'
])
- elif llvm_version >= distutils.version.LooseVersion('3.7'):
- env.Prepend(LIBS = [
- 'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
- 'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
- 'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMProfileData',
- 'LLVMInstCombine', 'LLVMInstrumentation', 'LLVMTransformUtils', 'LLVMipa',
- 'LLVMAnalysis', 'LLVMX86Desc', 'LLVMMCDisassembler',
- 'LLVMX86Info', 'LLVMX86AsmPrinter', 'LLVMX86Utils',
- 'LLVMMCJIT', 'LLVMTarget', 'LLVMExecutionEngine',
- 'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser',
- 'LLVMBitReader', 'LLVMMC', 'LLVMCore', 'LLVMSupport'
- ])
else:
env.Prepend(LIBS = [
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMProfileData',
- 'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
+ 'LLVMInstCombine', 'LLVMInstrumentation', 'LLVMTransformUtils', 'LLVMipa',
'LLVMAnalysis', 'LLVMX86Desc', 'LLVMMCDisassembler',
'LLVMX86Info', 'LLVMX86AsmPrinter', 'LLVMX86Utils',
'LLVMMCJIT', 'LLVMTarget', 'LLVMExecutionEngine',
/* Disable frame pointer omission on debug/profile builds */
/* XXX: And workaround http://llvm.org/PR21435 */
-#if (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)) && \
- (defined(DEBUG) || defined(PROFILE) || \
- defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64))
+#if defined(DEBUG) || defined(PROFILE) || defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim", "true");
LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim-non-leaf", "true");
#endif
#include <llvm/Config/llvm-config.h>
// Workaround http://llvm.org/PR23628
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)
-# pragma push_macro("DEBUG")
-# undef DEBUG
-#endif
+#pragma push_macro("DEBUG")
+#undef DEBUG
#include <llvm/Config/llvm-config.h>
#include <llvm-c/Core.h>
#include <llvm/Target/TargetOptions.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/ADT/Triple.h>
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)
#include <llvm/Analysis/TargetLibraryInfo.h>
-#else
-#include <llvm/Target/TargetLibraryInfo.h>
-#endif
#include <llvm/ExecutionEngine/SectionMemoryManager.h>
#include <llvm/Support/CommandLine.h>
#include <llvm/Support/Host.h>
#endif
// Workaround http://llvm.org/PR23628
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)
-# pragma pop_macro("DEBUG")
-#endif
+#pragma pop_macro("DEBUG")
#include "c11/threads.h"
#include "os/os_thread.h"
gallivm_create_target_library_info(const char *triple)
{
return reinterpret_cast<LLVMTargetLibraryInfoRef>(
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
- new llvm::TargetLibraryInfo(
-#else
new llvm::TargetLibraryInfoImpl(
-#endif
llvm::Triple(triple)));
}
gallivm_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info)
{
delete reinterpret_cast<
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
- llvm::TargetLibraryInfo
-#else
llvm::TargetLibraryInfoImpl
-#endif
*>(library_info);
}
options.StackAlignmentOverride = 4;
#endif
-#if defined(DEBUG) && (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7)
- options.JITEmitDebugInfo = true;
-#endif
-
- /* XXX: Workaround http://llvm.org/PR21435 */
-#if defined(DEBUG) || defined(PROFILE) || defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
- options.NoFramePointerElim = true;
-#endif
-#endif
-
builder.setEngineKind(EngineKind::JIT)
.setErrorStr(&Error)
.setTargetOptions(options)