Skip to content

Commit 225cc54

Browse files
committed
Increment version, force all types to be unsized.
1 parent 9bb8c3e commit 225cc54

File tree

13 files changed

+39
-33
lines changed

13 files changed

+39
-33
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ cbox = "0.*"
2424
libc = "0.*"
2525

2626
[dependencies.llvm-sys]
27-
version = "*"
28-
git = "https://github.com/TomBebbington/llvm-sys.rs"
27+
version = "0.*"
28+
git = "https://github.com/TomBebbington/llvm-rs"

src/block.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
use ffi::core;
22
use ffi::prelude::LLVMBasicBlockRef;
3+
use std::marker::PhantomData;
34
use value::Function;
45
use util;
56

67
/// A container of instructions that execute sequentially.
7-
pub struct BasicBlock;
8+
pub struct BasicBlock(PhantomData<[u8]>);
89
native_ref!(&BasicBlock = LLVMBasicBlockRef);
910
impl BasicBlock {
1011
/// Return the enclosing method, or `None` if it is not attached to a method.

src/buffer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ use ffi::{core, LLVMMemoryBuffer};
33
use ffi::prelude::LLVMMemoryBufferRef;
44
use cbox::{CBox, DisposeRef};
55
use std::ops::Deref;
6+
use std::marker::PhantomData;
67
use std::mem;
78
use util;
89

910

10-
pub struct MemoryBuffer;
11+
pub struct MemoryBuffer(PhantomData<[u8]>);
1112
native_ref!(&MemoryBuffer = LLVMMemoryBufferRef);
1213
impl MemoryBuffer {
1314
pub fn new_from_file(path: &str) -> Result<CBox<MemoryBuffer>, CBox<str>> {

src/builder.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ use libc::{c_char, c_uint};
22
use ffi::prelude::{LLVMBuilderRef, LLVMValueRef};
33
use ffi::{core, LLVMBuilder, LLVMRealPredicate, LLVMIntPredicate};
44
use cbox::{CSemiBox, DisposeRef};
5+
use std::marker::PhantomData;
56
use std::mem;
67
use block::BasicBlock;
78
use context::Context;
8-
use ty::Type;
9+
use types::Type;
910
use value::{Function, Value, Predicate};
1011

1112
static NULL_NAME:[c_char; 1] = [0];
1213

1314
/// This provides a uniform API for creating instructions and inserting them into a basic block.
14-
pub struct Builder;
15+
pub struct Builder(PhantomData<[u8]>);
1516
native_ref!(&Builder = LLVMBuilderRef);
1617
macro_rules! bin_op(
1718
($name:ident, $func:ident) => (

src/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use ffi::prelude::LLVMValueRef;
44
use context::Context;
55
use libc::c_char;
66
use value::Value;
7-
use ty::*;
7+
use types::*;
88
use std::mem;
99
use std::ffi::CStr;
1010

src/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
use ffi::prelude::LLVMContextRef;
22
use ffi::{core, LLVMContext};
3+
use std::marker::PhantomData;
34
use cbox::CBox;
45

56
/// Contains all the LLVM entities - mainly modules.
67
///
78
/// Every single entity attached to it has its lifetime to enforce the
89
/// rule that things from different contexts cannot interact and to
910
/// preserve pointer safety.
10-
pub struct Context;
11+
pub struct Context(PhantomData<[u8]>);
1112
native_ref!(&Context = LLVMContextRef);
1213
impl Context {
1314
/// Get a reference to the global context.

src/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::{mem, ptr};
99
use compile::Compile;
1010
use context::{Context, GetContext};
1111
use module::Module;
12-
use ty::{StructType, Type};
12+
use types::{StructType, Type};
1313
use util::{self, Sub};
1414
use value::{Function, Value};
1515

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ mod engine;
1919
mod module;
2020
mod object;
2121
mod target;
22-
mod ty;
23-
mod value;
22+
pub mod types;
23+
pub mod value;
2424
mod util;
2525

2626
pub use cbox::{CBox, CSemiBox};
@@ -32,6 +32,6 @@ pub use engine::{JitEngine, JitOptions, Interpreter, ExecutionEngine, GenericVal
3232
pub use module::{AddressSpace, Module, Functions};
3333
pub use object::{ObjectFile, Symbol, Symbols};
3434
pub use target::{TargetData, Target};
35-
pub use ty::{FunctionType, StructType, Type};
35+
pub use types::*;
3636
pub use value::{Alias, Arg, Attribute, Value, Function, GlobalValue, GlobalVariable, Linkage, Predicate};
3737
pub use util::Sub;

src/module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ use std::process::Command;
1717
use buffer::MemoryBuffer;
1818
use context::{Context, GetContext};
1919
use value::{Alias, Function, GlobalValue, GlobalVariable, Value};
20-
use ty::Type;
20+
use types::Type;
2121
use util;
2222

2323
/// Represents a single compilation unit of code.
2424
///
2525
/// This is attached to the lifetime of the context that constructs it, but is owned by the `CSemiBox`.
26-
pub struct Module;
26+
pub struct Module(PhantomData<[u8]>);
2727
native_ref!(&Module = LLVMModuleRef);
2828
impl Module {
2929
/// Create a new module in the context given with the name given.

0 commit comments

Comments
 (0)