From 35d62be3343ce7c61b48ea28faa78f0f3aae21e2 Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Tue, 12 May 2009 16:02:51 +0200 Subject: [PATCH] Remove some other code that tested for LLVM before r67588. --- gen/linkage.h | 18 ------------------ gen/main.cpp | 11 ----------- gen/tollvm.cpp | 8 -------- 3 files changed, 37 deletions(-) diff --git a/gen/linkage.h b/gen/linkage.h index 506ce50bde..c296df98a7 100644 --- a/gen/linkage.h +++ b/gen/linkage.h @@ -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 --git a/gen/main.cpp b/gen/main.cpp index adcf2d519e..4a8d06fd9d 100644 --- a/gen/main.cpp +++ b/gen/main.cpp @@ -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 @@ int main(int argc, char** argv) 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 --git a/gen/tollvm.cpp b/gen/tollvm.cpp index 49adecf5ac..a2376a6bbf 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -543,16 +543,8 @@ llvm::ConstantFP* DtoConstFP(Type* t, long double value) 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");