pub struct Target { /* private fields */ }
Implementations§
source§impl Target
impl Target
pub unsafe fn new(target: LLVMTargetRef) -> Self
sourcepub fn as_mut_ptr(&self) -> LLVMTargetRef
pub fn as_mut_ptr(&self) -> LLVMTargetRef
Acquires the underlying raw pointer belonging to this Target
type.
pub fn initialize_x86(config: &InitializationConfig)
pub fn initialize_arm(config: &InitializationConfig)
pub fn initialize_mips(config: &InitializationConfig)
pub fn initialize_aarch64(config: &InitializationConfig)
pub fn initialize_amd_gpu(config: &InitializationConfig)
pub fn initialize_system_z(config: &InitializationConfig)
pub fn initialize_hexagon(config: &InitializationConfig)
pub fn initialize_nvptx(config: &InitializationConfig)
pub fn initialize_msp430(config: &InitializationConfig)
pub fn initialize_x_core(config: &InitializationConfig)
pub fn initialize_power_pc(config: &InitializationConfig)
pub fn initialize_sparc(config: &InitializationConfig)
pub fn initialize_bpf(config: &InitializationConfig)
pub fn initialize_lanai(config: &InitializationConfig)
pub fn initialize_riscv(config: &InitializationConfig)
pub fn initialize_loongarch(config: &InitializationConfig)
pub fn initialize_webassembly(config: &InitializationConfig)
pub fn initialize_native(config: &InitializationConfig) -> Result<(), String>
pub fn initialize_all(config: &InitializationConfig)
pub fn create_target_machine( &self, triple: &TargetTriple, cpu: &str, features: &str, level: OptimizationLevel, reloc_mode: RelocMode, code_model: CodeModel, ) -> Option<TargetMachine>
sourcepub fn create_target_machine_from_options(
&self,
triple: &TargetTriple,
options: TargetMachineOptions,
) -> Option<TargetMachine>
pub fn create_target_machine_from_options( &self, triple: &TargetTriple, options: TargetMachineOptions, ) -> Option<TargetMachine>
Create a target machine from given TargetMachineOptions.
§Example
use inkwell::targets::{InitializationConfig, Target, TargetTriple, TargetMachineOptions};
use inkwell::OptimizationLevel;
Target::initialize_x86(&InitializationConfig::default());
let triple = TargetTriple::create("x86_64-pc-linux-gnu");
let target = Target::from_triple(&triple).unwrap();
let options = TargetMachineOptions::default()
.set_cpu("x86-64")
.set_features("+avx2")
.set_abi("sysv")
.set_level(OptimizationLevel::Aggressive);
let target_machine = target.create_target_machine_from_options(&triple, options).unwrap();
assert_eq!(target_machine.get_cpu().to_str(), Ok("x86-64"));
assert_eq!(target_machine.get_feature_string().to_str(), Ok("+avx2"));
pub fn get_first() -> Option<Self>
pub fn get_next(&self) -> Option<Self>
pub fn get_name(&self) -> &CStr
pub fn get_description(&self) -> &CStr
pub fn from_name(name: &str) -> Option<Self>
pub fn from_triple(triple: &TargetTriple) -> Result<Self, LLVMString>
pub fn has_jit(&self) -> bool
pub fn has_target_machine(&self) -> bool
pub fn has_asm_backend(&self) -> bool
Trait Implementations§
source§impl PartialEq for Target
impl PartialEq for Target
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl !Send for Target
impl !Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more