aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2021-09-25 18:08:26 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2021-09-25 18:08:26 +0200
commita3dee93989b9fdd99b8a22a2da7f72bcd2ba50c2 (patch)
tree947b4ece2d69d247d963a592bc037f00b8990e24
parent6eb6ad9f574c783d471f6a863299af25b6f5a8c7 (diff)
downloadllvm-kaleidoscope-rs-a3dee93989b9fdd99b8a22a2da7f72bcd2ba50c2.tar.gz
llvm-kaleidoscope-rs-a3dee93989b9fdd99b8a22a2da7f72bcd2ba50c2.zip
ch4: update README + lljit rustdocschapter4
-rw-r--r--README.md3
-rw-r--r--src/llvm/lljit.rs7
2 files changed, 7 insertions, 3 deletions
diff --git a/README.md b/README.md
index 0f5f637..af4d8b6 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ out the corresponding tag for the chapter.
chapter1
chapter2
chapter3
+chapter4
```
Names of variables and functions as well as the structure of the functions are
@@ -25,7 +26,7 @@ tutorial.
One further note on the llvm API, instead of using the llvm `C++` API we are
going to use the llvm `C` API and build our own safe wrapper specialized for
this tutorial. The wrapper offers a similar interface as the `C++` API and is
-implemented in [`src/llvm.rs`](src/llvm.rs)
+implemented in [`src/llvm/`](src/llvm/)
## Documentation
diff --git a/src/llvm/lljit.rs b/src/llvm/lljit.rs
index 88c7059..a68e9fa 100644
--- a/src/llvm/lljit.rs
+++ b/src/llvm/lljit.rs
@@ -19,6 +19,7 @@ pub trait JitFn {}
impl JitFn for unsafe extern "C" fn() -> f64 {}
+/// Wrapper for a LLVM [LLJIT](https://www.llvm.org/docs/ORCv2.html#lljit-and-lllazyjit).
pub struct LLJit {
jit: LLVMOrcLLJITRef,
dylib: LLVMOrcJITDylibRef,
@@ -125,8 +126,10 @@ impl LLJit {
}
}
-/// A resource handle to code added to an [`LLJit`] instance. When a `ResourceTracker` handle is
-/// dropped, the code corresponding to the handle will be removed from the JIT.
+/// A resource handle for code added to an [`LLJit`] instance.
+///
+/// When a `ResourceTracker` handle is dropped, the code corresponding to the handle will be
+/// removed from the JIT.
pub struct ResourceTracker<'jit>(LLVMOrcResourceTrackerRef, PhantomData<&'jit ()>);
impl<'jit> ResourceTracker<'jit> {