Remove some other code that tested for LLVM before r67588.

This commit is contained in:
Frits van Bommel 2009-05-12 16:02:51 +02:00
parent ec476cc5f1
commit 35d62be334
3 changed files with 0 additions and 37 deletions

View file

@ -1,31 +1,13 @@
#ifndef LDC_GEN_LINKAGE_H #ifndef LDC_GEN_LINKAGE_H
#define LDC_GEN_LINKAGE_H #define LDC_GEN_LINKAGE_H
#include "gen/llvm-version.h"
// Make it easier to test new linkage types // 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 TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage
# define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage # define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage
// The One-Definition-Rule shouldn't matter for debug info, right? // The One-Definition-Rule shouldn't matter for debug info, right?
# define DEBUGINFO_LINKONCE_LINKAGE_TYPE \ # define DEBUGINFO_LINKONCE_LINKAGE_TYPE \
llvm::GlobalValue::LinkOnceAnyLinkage 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 #endif

View file

@ -37,7 +37,6 @@
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/toobj.h" #include "gen/toobj.h"
#include "gen/passes/Passes.h" #include "gen/passes/Passes.h"
#include "gen/llvm-version.h"
#include "gen/cl_options.h" #include "gen/cl_options.h"
#include "gen/cl_helpers.h" #include "gen/cl_helpers.h"
@ -881,16 +880,6 @@ int main(int argc, char** argv)
delete llvmModules[i]; 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(); m->deleteObjFile();
writeModule(linker.getModule(), filename); writeModule(linker.getModule(), filename);
global.params.objfiles->push(filename); global.params.objfiles->push(filename);

View file

@ -543,16 +543,8 @@ llvm::ConstantFP* DtoConstFP(Type* t, long double value)
return LLConstantFP::get(llty, value); return LLConstantFP::get(llty, value);
else if(llty == LLType::X86_FP80Ty) { else if(llty == LLType::X86_FP80Ty) {
uint64_t bits[] = {0, 0}; 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[0] = *(uint64_t*)&value;
bits[1] = *(uint16_t*)((uint64_t*)&value + 1); bits[1] = *(uint16_t*)((uint64_t*)&value + 1);
#endif
return LLConstantFP::get(APFloat(APInt(80, 2, bits))); return LLConstantFP::get(APFloat(APInt(80, 2, bits)));
} else { } else {
assert(0 && "Unknown floating point type encountered"); assert(0 && "Unknown floating point type encountered");