# HG changeset patch # User Frits van Bommel # Date 1242136971 -7200 # Node ID 3647bef175d735d159a14f63bce0388b71263dba # Parent 6f4154b318ef508d307a22750539802ba6fe6a3f Remove some other code that tested for LLVM before r67588. diff -r 6f4154b318ef -r 3647bef175d7 gen/linkage.h --- a/gen/linkage.h Tue May 12 15:50:48 2009 +0200 +++ b/gen/linkage.h Tue May 12 16:02:51 2009 +0200 @@ -1,31 +1,13 @@ #ifndef LDC_GEN_LINKAGE_H #define LDC_GEN_LINKAGE_H -#include "gen/llvm-version.h" - // Make it easier to test new linkage types -// Also used to adapt to some changes in LLVM between 2.5 and 2.6 - -// LLVM r66339 introduces LinkOnceODRLinkage, which is just what we want here. -// (It also renamed LinkOnceLinkage, so this #if is needed for LDC to compile -// with both 2.5 and trunk) -#if LLVM_REV >= 66339 # define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage # define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage // The One-Definition-Rule shouldn't matter for debug info, right? # define DEBUGINFO_LINKONCE_LINKAGE_TYPE \ llvm::GlobalValue::LinkOnceAnyLinkage -// For 2.5 and any LLVM revision before 66339 we want to use LinkOnceLinkage -// It's equivalent to LinkOnceAnyLinkage in trunk except that the inliner had a -// hack (removed in r66339) to allow inlining of templated functions even though -// LinkOnce doesn't technically allow that. -#else -# define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceLinkage -# define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceLinkage -# define DEBUGINFO_LINKONCE_LINKAGE_TYPE \ - llvm::GlobalValue::LinkOnceLinkage -#endif #endif diff -r 6f4154b318ef -r 3647bef175d7 gen/main.cpp --- a/gen/main.cpp Tue May 12 15:50:48 2009 +0200 +++ b/gen/main.cpp Tue May 12 16:02:51 2009 +0200 @@ -37,7 +37,6 @@ #include "gen/irstate.h" #include "gen/toobj.h" #include "gen/passes/Passes.h" -#include "gen/llvm-version.h" #include "gen/cl_options.h" #include "gen/cl_helpers.h" @@ -881,16 +880,6 @@ delete llvmModules[i]; } -#if LLVM_REV < 66404 - // Workaround for llvm bug #3749 - // Not needed since LLVM r66404 (it no longer checks for this) - llvm::GlobalVariable* ctors = linker.getModule()->getGlobalVariable("llvm.global_ctors"); - if (ctors) { - ctors->removeDeadConstantUsers(); - assert(ctors->use_empty()); - } -#endif - m->deleteObjFile(); writeModule(linker.getModule(), filename); global.params.objfiles->push(filename); diff -r 6f4154b318ef -r 3647bef175d7 gen/tollvm.cpp --- a/gen/tollvm.cpp Tue May 12 15:50:48 2009 +0200 +++ b/gen/tollvm.cpp Tue May 12 16:02:51 2009 +0200 @@ -543,16 +543,8 @@ return LLConstantFP::get(llty, value); else if(llty == LLType::X86_FP80Ty) { uint64_t bits[] = {0, 0}; - #if LLVM_REV < 67562 - // Prior to r67562, the i80 APInt format expected by the APFloat - // constructor was different than the memory layout on the actual - // processor. - bits[1] = *(uint16_t*)&value; - bits[0] = *(uint64_t*)((uint16_t*)&value + 1); - #else bits[0] = *(uint64_t*)&value; bits[1] = *(uint16_t*)((uint64_t*)&value + 1); - #endif return LLConstantFP::get(APFloat(APInt(80, 2, bits))); } else { assert(0 && "Unknown floating point type encountered");