Support LLVM 7, 8 and 9. Bump default required version to 7.
Fixes #48.
This commit is contained in:
parent
1bdb2d64c9
commit
439ef31f94
|
@ -1,7 +1,7 @@
|
||||||
# Copyright 2017 the Monicelli project authors. All rights reserved.
|
# Copyright 2017 the Monicelli project authors. All rights reserved.
|
||||||
# Use of this source code is governed by a GPLv3 license, see LICENSE.txt.
|
# Use of this source code is governed by a GPLv3 license, see LICENSE.txt.
|
||||||
|
|
||||||
find_package(LLVM 6.0 REQUIRED CONFIG)
|
find_package(LLVM 7 REQUIRED CONFIG)
|
||||||
find_package(Ragel REQUIRED)
|
find_package(Ragel REQUIRED)
|
||||||
|
|
||||||
set(MONICELLI_LINKER ON CACHE BOOL "Enable the Monicelli linker. Requires POSIX.")
|
set(MONICELLI_LINKER ON CACHE BOOL "Enable the Monicelli linker. Requires POSIX.")
|
||||||
|
|
|
@ -58,7 +58,7 @@ void writeAssembly(const std::string& to_filename, llvm::Module* module,
|
||||||
llvm::legacy::PassManager asm_generator;
|
llvm::legacy::PassManager asm_generator;
|
||||||
auto file_type = llvm::TargetMachine::CGFT_ObjectFile;
|
auto file_type = llvm::TargetMachine::CGFT_ObjectFile;
|
||||||
|
|
||||||
if (target_machine->addPassesToEmitFile(asm_generator, output, file_type)) {
|
if (target_machine->addPassesToEmitFile(asm_generator, output, nullptr, file_type)) {
|
||||||
std::cerr << "Cannot emit an object file of this type\n";
|
std::cerr << "Cannot emit an object file of this type\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,10 @@
|
||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
#include "llvm/IR/Verifier.h"
|
#include "llvm/IR/Verifier.h"
|
||||||
#include "llvm/Support/raw_os_ostream.h"
|
#include "llvm/Support/raw_os_ostream.h"
|
||||||
|
#include "llvm/Transforms/InstCombine/InstCombine.h"
|
||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
#include "llvm/Transforms/Scalar/GVN.h"
|
#include "llvm/Transforms/Scalar/GVN.h"
|
||||||
|
#include "llvm/Transforms/Utils.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user