Changeset 1347:3647bef175d7
- Timestamp:
- 05/12/09 10:02:51
(3 years ago)
- Author:
- Frits van Bommel <fvbommel wxs.nl>
- branch:
- default
- Message:
Remove some other code that tested for LLVM before r67588.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1113 |
r1347 |
|
| 2 | 2 | #define LDC_GEN_LINKAGE_H |
|---|
| 3 | 3 | |
|---|
| 4 | | #include "gen/llvm-version.h" |
|---|
| | 4 | // Make it easier to test new linkage types |
|---|
| 5 | 5 | |
|---|
| 6 | | // Make it easier to test new linkage types |
|---|
| 7 | | // Also used to adapt to some changes in LLVM between 2.5 and 2.6 |
|---|
| 8 | | |
|---|
| 9 | | |
|---|
| 10 | | // LLVM r66339 introduces LinkOnceODRLinkage, which is just what we want here. |
|---|
| 11 | | // (It also renamed LinkOnceLinkage, so this #if is needed for LDC to compile |
|---|
| 12 | | // with both 2.5 and trunk) |
|---|
| 13 | | #if LLVM_REV >= 66339 |
|---|
| 14 | 6 | # define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage |
|---|
| 15 | 7 | # define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage |
|---|
| … | … | |
| 18 | 10 | llvm::GlobalValue::LinkOnceAnyLinkage |
|---|
| 19 | 11 | |
|---|
| 20 | | // For 2.5 and any LLVM revision before 66339 we want to use LinkOnceLinkage |
|---|
| 21 | | // It's equivalent to LinkOnceAnyLinkage in trunk except that the inliner had a |
|---|
| 22 | | // hack (removed in r66339) to allow inlining of templated functions even though |
|---|
| 23 | | // LinkOnce doesn't technically allow that. |
|---|
| 24 | | #else |
|---|
| 25 | | # define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceLinkage |
|---|
| 26 | | # define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceLinkage |
|---|
| 27 | | # define DEBUGINFO_LINKONCE_LINKAGE_TYPE \ |
|---|
| 28 | | llvm::GlobalValue::LinkOnceLinkage |
|---|
| 29 | | #endif |
|---|
| 30 | 12 | |
|---|
| 31 | 13 | #endif |
|---|
| r1324 |
r1347 |
|
| 38 | 38 | #include "gen/toobj.h" |
|---|
| 39 | 39 | #include "gen/passes/Passes.h" |
|---|
| 40 | | #include "gen/llvm-version.h" |
|---|
| 41 | 40 | |
|---|
| 42 | 41 | #include "gen/cl_options.h" |
|---|
| … | … | |
| 882 | 881 | } |
|---|
| 883 | 882 | |
|---|
| 884 | | #if LLVM_REV < 66404 |
|---|
| 885 | | // Workaround for llvm bug #3749 |
|---|
| 886 | | // Not needed since LLVM r66404 (it no longer checks for this) |
|---|
| 887 | | llvm::GlobalVariable* ctors = linker.getModule()->getGlobalVariable("llvm.global_ctors"); |
|---|
| 888 | | if (ctors) { |
|---|
| 889 | | ctors->removeDeadConstantUsers(); |
|---|
| 890 | | assert(ctors->use_empty()); |
|---|
| 891 | | } |
|---|
| 892 | | #endif |
|---|
| 893 | | |
|---|
| 894 | 883 | m->deleteObjFile(); |
|---|
| 895 | 884 | writeModule(linker.getModule(), filename); |
|---|
| r1323 |
r1347 |
|
| 544 | 544 | else if(llty == LLType::X86_FP80Ty) { |
|---|
| 545 | 545 | uint64_t bits[] = {0, 0}; |
|---|
| 546 | | #if LLVM_REV < 67562 |
|---|
| 547 | | // Prior to r67562, the i80 APInt format expected by the APFloat |
|---|
| 548 | | // constructor was different than the memory layout on the actual |
|---|
| 549 | | // processor. |
|---|
| 550 | | bits[1] = *(uint16_t*)&value; |
|---|
| 551 | | bits[0] = *(uint64_t*)((uint16_t*)&value + 1); |
|---|
| 552 | | #else |
|---|
| 553 | 546 | bits[0] = *(uint64_t*)&value; |
|---|
| 554 | 547 | bits[1] = *(uint16_t*)((uint64_t*)&value + 1); |
|---|
| 555 | | #endif |
|---|
| 556 | 548 | return LLConstantFP::get(APFloat(APInt(80, 2, bits))); |
|---|
| 557 | 549 | } else { |
|---|