This repository has been archived by the owner on Jul 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add minimal JIT compiler based on LLJIT
- Loading branch information
1 parent
81a9d8b
commit 731f482
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "JitFromScratch.h" | ||
|
||
using namespace llvm; | ||
using namespace llvm::orc; | ||
|
||
JitFromScratch::JitFromScratch(ExitOnError ExitOnErr) | ||
: LLJIT(ExitOnErr(LLJITBuilder().create())) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <llvm/ExecutionEngine/Orc/LLJIT.h> | ||
|
||
#include <memory> | ||
|
||
class JitFromScratch { | ||
public: | ||
JitFromScratch(llvm::ExitOnError ExitOnErr); | ||
|
||
// Not a value type. | ||
JitFromScratch(const JitFromScratch &) = delete; | ||
JitFromScratch &operator=(const JitFromScratch &) = delete; | ||
JitFromScratch(JitFromScratch &&) = delete; | ||
JitFromScratch &operator=(JitFromScratch &&) = delete; | ||
|
||
private: | ||
std::unique_ptr<llvm::orc::LLJIT> LLJIT; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters