Skip to content

Commit

Permalink
Use LLVMnn instead of explicitly checking LLVM_VERSION_*
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Dec 12, 2015
1 parent c741432 commit 3e75d02
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6298,7 +6298,7 @@ extern "C" void jl_init_codegen(void)
#endif
jl_init_debuginfo();

#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 3
#ifndef LLVM34
// this option disables LLVM's signal handlers
llvm::DisablePrettyStackTrace = true;
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/llvm-simdloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void LowerSIMDLoop::enableUnsafeAlgebraIfReduction(PHINode* Phi, Loop* L) const
for (Instruction *I = Phi; ; I=J) {
J = NULL;
// Find the user of instruction I that is within loop L.
#if defined(LLVM_VERSION_MAJOR) && LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
#ifdef LLVM35
for (User *UI : I->users()) { /*}*/
Instruction *U = cast<Instruction>(UI);
#else
Expand Down Expand Up @@ -149,7 +149,7 @@ bool LowerSIMDLoop::runOnLoop(Loop *L, LPPassManager &LPM)
return false;

DEBUG(dbgs() << "LSL: simd_loop found\n");
#if defined(LLVM_VERSION_MAJOR) && LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 4
#ifdef LLVM34
MDNode* n = L->getLoopID();
if (!n) {
// Loop does not have a LoopID yet, so give it one.
Expand Down
6 changes: 3 additions & 3 deletions src/runtime_ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ void *jl_load_and_lookup(const char *f_lib, const char *f_name, void **hnd)
extern "C" JL_DLLEXPORT
jl_value_t *jl_get_cpu_name(void)
{
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 5
std::string HostCPUName = llvm::sys::getHostCPUName();
#else
#ifdef LLVM35
StringRef HostCPUName = llvm::sys::getHostCPUName();
#else
const std::string& HostCPUName = llvm::sys::getHostCPUName();
#endif
return jl_pchar_to_string(HostCPUName.data(), HostCPUName.size());
}

0 comments on commit 3e75d02

Please sign in to comment.