mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add lto version check mechanism.
llvm-svn: 45238
This commit is contained in:
parent
4c9ef1e54f
commit
61ad7ec0f7
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user