llvm.org GIT mirror llvm / e361187
Add lto version check mechanism. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45238 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 11 years ago
2 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1818 #include
1919 #include
2020 #include
21
22 #define LLVM_LTO_VERSION 1
2123
2224 namespace llvm {
2325
147149 /// linker to use dlopen() interface to dynamically load LinkTimeOptimizer.
148150 /// extern "C" helps, because dlopen() interface uses name to find the symbol.
149151 extern "C"
150 llvm::LinkTimeOptimizer *createLLVMOptimizer();
152 llvm::LinkTimeOptimizer *createLLVMOptimizer(unsigned VERSION = LLVM_LTO_VERSION);
151153
152154 #endif
4444 using namespace llvm;
4545
4646 extern "C"
47 llvm::LinkTimeOptimizer *createLLVMOptimizer()
48 {
47 llvm::LinkTimeOptimizer *createLLVMOptimizer(unsigned VERSION)
48 {
49 if (VERSION != LLVM_LTO_VERSION)
50 return NULL;
51
4952 llvm::LTO *l = new llvm::LTO();
5053 return l;
5154 }