mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Add lto version check mechanism.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45238 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1475142b93
commit
e3611871cb
@ -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