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:
@@ -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()) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user