1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Add lto version check mechanism.

llvm-svn: 45238
This commit is contained in:
Devang Patel 2007-12-20 00:24:01 +00:00
parent 4c9ef1e54f
commit 61ad7ec0f7
2 changed files with 7 additions and 2 deletions

View File

@ -20,6 +20,8 @@
#include <set>
#include <llvm/ADT/hash_map>
#define LLVM_LTO_VERSION 1
namespace llvm {
class Module;
@ -148,6 +150,6 @@ namespace llvm {
/// linker to use dlopen() interface to dynamically load LinkTimeOptimizer.
/// extern "C" helps, because dlopen() interface uses name to find the symbol.
extern "C"
llvm::LinkTimeOptimizer *createLLVMOptimizer();
llvm::LinkTimeOptimizer *createLLVMOptimizer(unsigned VERSION = LLVM_LTO_VERSION);
#endif

View File

@ -45,8 +45,11 @@
using namespace llvm;
extern "C"
llvm::LinkTimeOptimizer *createLLVMOptimizer()
llvm::LinkTimeOptimizer *createLLVMOptimizer(unsigned VERSION)
{
if (VERSION != LLVM_LTO_VERSION)
return NULL;
llvm::LTO *l = new llvm::LTO();
return l;
}