Add OwnedTargetMachine to manage llvm:TargetMachine. Uses pointers
instead of &'static mut and provides safe interface to create/dispose it.
This commit is contained in:
parent
fc61fabc24
commit
3409ca65d8
7 changed files with 148 additions and 40 deletions
|
@ -79,3 +79,9 @@ impl<'a> FromIterator<&'a str> for SmallCStr {
|
|||
Self { data }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&ffi::CStr> for SmallCStr {
|
||||
fn from(s: &ffi::CStr) -> Self {
|
||||
Self { data: SmallVec::from_slice(s.to_bytes()) }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue