Mercurial > projects > ldc
comparison gen/linkage.h @ 1347:3647bef175d7
Remove some other code that tested for LLVM before r67588.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Tue, 12 May 2009 16:02:51 +0200 |
parents | 123812e02bc8 |
children | 11b122f92136 |
comparison
equal
deleted
inserted
replaced
1346:6f4154b318ef | 1347:3647bef175d7 |
---|---|
1 #ifndef LDC_GEN_LINKAGE_H | 1 #ifndef LDC_GEN_LINKAGE_H |
2 #define LDC_GEN_LINKAGE_H | 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 # define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage | 6 # define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage |
15 # define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage | 7 # define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage |
16 // The One-Definition-Rule shouldn't matter for debug info, right? | 8 // The One-Definition-Rule shouldn't matter for debug info, right? |
17 # define DEBUGINFO_LINKONCE_LINKAGE_TYPE \ | 9 # define DEBUGINFO_LINKONCE_LINKAGE_TYPE \ |
18 llvm::GlobalValue::LinkOnceAnyLinkage | 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 #endif | 13 #endif |