From 73e25a571f12d3deaa6f4493a5b4792a9dae39eb Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 24 Sep 2022 22:38:40 +0000 Subject: deploy: 295081130ca1eed6e67dfc035e2df2c9ed49b174 --- src/llvm_kaleidoscope_rs/llvm/mod.rs.html | 56 ++++++++++++++----------------- 1 file changed, 26 insertions(+), 30 deletions(-) (limited to 'src/llvm_kaleidoscope_rs/llvm/mod.rs.html') diff --git a/src/llvm_kaleidoscope_rs/llvm/mod.rs.html b/src/llvm_kaleidoscope_rs/llvm/mod.rs.html index d6eb8b2..3dca9c7 100644 --- a/src/llvm_kaleidoscope_rs/llvm/mod.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/mod.rs.html @@ -1,12 +1,18 @@ -mod.rs - source
 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
+mod.rs - source
+    
1
+2
+3
+4
+5
+6
+7
+8
+9
 10
 11
 12
@@ -72,12 +78,7 @@
 72
 73
 74
-75
-76
-77
-78
-
-//! Safe wrapper around the LLVM C API.
+
//! Safe wrapper around the LLVM C API.
 //!
 //! References returned from the LLVM API are tied to the `'llvm` lifetime which is bound to the
 //! context where the objects are created in.
@@ -90,7 +91,6 @@
 use llvm_sys::{
     core::LLVMShutdown,
     error::{LLVMDisposeErrorMessage, LLVMErrorRef, LLVMGetErrorMessage},
-    prelude::LLVMBasicBlockRef,
     target::{
         LLVM_InitializeNativeAsmParser, LLVM_InitializeNativeAsmPrinter,
         LLVM_InitializeNativeTarget,
@@ -98,8 +98,8 @@
 };
 
 use std::ffi::CStr;
-use std::marker::PhantomData;
 
+mod basic_block;
 mod builder;
 mod lljit;
 mod module;
@@ -107,25 +107,22 @@
 mod type_;
 mod value;
 
+pub use basic_block::BasicBlock;
 pub use builder::IRBuilder;
 pub use lljit::{LLJit, ResourceTracker};
 pub use module::Module;
 pub use pass_manager::FunctionPassManager;
 pub use type_::Type;
-pub use value::{FnValue, Value};
-
-/// Wrapper for a LLVM Basic Block.
-#[derive(Copy, Clone)]
-pub struct BasicBlock<'llvm>(LLVMBasicBlockRef, PhantomData<&'llvm ()>);
+pub use value::{FnValue, PhiValue, Value};
 
 struct Error<'llvm>(&'llvm mut libc::c_char);
 
 impl<'llvm> Error<'llvm> {
-    fn from(err: LLVMErrorRef) -> Option<Error<'llvm>> {
-        (!err.is_null()).then(|| Error(unsafe { &mut *LLVMGetErrorMessage(err) }))
+    fn from(err: LLVMErrorRef) -> Option<Error<'llvm>> {
+        (!err.is_null()).then(|| Error(unsafe { &mut *LLVMGetErrorMessage(err) }))
     }
 
-    fn as_str(&self) -> &str {
+    fn as_str(&self) -> &str {
         unsafe { CStr::from_ptr(self.0) }
             .to_str()
             .expect("Expected valid UTF8 string from LLVM API")
@@ -133,9 +130,9 @@
 }
 
 impl Drop for Error<'_> {
-    fn drop(&mut self) {
+    fn drop(&mut self) {
         unsafe {
-            LLVMDisposeErrorMessage(self.0 as *mut libc::c_char);
+            LLVMDisposeErrorMessage(self.0 as *mut libc::c_char);
         }
     }
 }
@@ -155,7 +152,6 @@
         LLVMShutdown();
     };
 }
-
-
- +
+
\ No newline at end of file -- cgit v1.2.3