aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2022-07-07-llvm-orc-jit/ccompiler.h
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-12-19 18:53:31 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-12-19 18:54:35 +0100
commita599959a61e2a9ae313b851b2b63c0a2b97d3cb5 (patch)
treece0b3346b48df0926560c305394ff04b86fcccb3 /content/2022-07-07-llvm-orc-jit/ccompiler.h
parent34fe7e1b93f73dc8ffb42cc172f4a9966453faa9 (diff)
downloadblog-a599959a61e2a9ae313b851b2b63c0a2b97d3cb5.tar.gz
blog-a599959a61e2a9ae313b851b2b63c0a2b97d3cb5.zip
llvm-orc-jit: migrate to llvm17
Diffstat (limited to 'content/2022-07-07-llvm-orc-jit/ccompiler.h')
-rw-r--r--content/2022-07-07-llvm-orc-jit/ccompiler.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/content/2022-07-07-llvm-orc-jit/ccompiler.h b/content/2022-07-07-llvm-orc-jit/ccompiler.h
index 57a2b62..368fc21 100644
--- a/content/2022-07-07-llvm-orc-jit/ccompiler.h
+++ b/content/2022-07-07-llvm-orc-jit/ccompiler.h
@@ -8,8 +8,8 @@
#include <clang/Lex/PreprocessorOptions.h>
#include <llvm/IR/Module.h>
-#include <llvm/Support/Host.h>
#include <llvm/Support/TargetSelect.h>
+#include <llvm/TargetParser/Host.h>
namespace cc {
@@ -21,7 +21,6 @@ using clang::DiagnosticsEngine;
using clang::EmitLLVMOnlyAction;
using clang::TextDiagnosticPrinter;
-using llvm::cantFail;
using llvm::Expected;
using llvm::IntrusiveRefCntPtr;
using llvm::LLVMContext;
@@ -51,7 +50,7 @@ public:
std::unique_ptr<Module> M;
};
- Expected<CompileResult> compile(const char *code) const {
+ Expected<CompileResult> compile(const char* code) const {
using std::errc;
const auto err = [](errc ec) { return std::make_error_code(ec); };
@@ -77,7 +76,7 @@ public:
code_fname, MemoryBuffer::getMemBuffer(code).release());
// Configure codegen options.
- auto &CG = CC.getCodeGenOpts();
+ auto& CG = CC.getCodeGenOpts();
CG.OptimizationLevel = 3;
CG.setInlining(clang::CodeGenOptions::NormalInlining);
@@ -104,6 +103,6 @@ private:
std::unique_ptr<DiagnosticsEngine> DE;
};
-} // namespace cc
+} // namespace cc
#endif