[][src]Struct inkwell::values::IntValue

pub struct IntValue<'ctx> { /* fields omitted */ }

Implementations

impl<'ctx> IntValue<'ctx>[src]

pub fn get_name(&self) -> &CStr[src]

Gets the name of an IntValue. If the value is a constant, this will return an empty string.

pub fn get_type(self) -> IntType<'ctx>[src]

pub fn is_null(self) -> bool[src]

pub fn is_undef(self) -> bool[src]

pub fn print_to_stderr(self)[src]

pub fn as_instruction(self) -> Option<InstructionValue<'ctx>>[src]

pub fn const_not(self) -> Self[src]

pub fn const_neg(self) -> Self[src]

pub fn const_nsw_neg(self) -> Self[src]

pub fn const_nuw_neg(self) -> Self[src]

pub fn const_add(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_nsw_add(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_nuw_add(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_sub(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_nsw_sub(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_nuw_sub(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_mul(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_nsw_mul(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_nuw_mul(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_unsigned_div(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_signed_div(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_exact_signed_div(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_exact_unsigned_div(self, rhs: IntValue<'ctx>) -> Self[src]

This is supported on crate features llvm4-0 or llvm5-0 or llvm6-0 or llvm7-0 or llvm8-0 or llvm9-0 or llvm10-0 only.

pub fn const_unsigned_remainder(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_signed_remainder(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_and(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_or(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_xor(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_cast(self, int_type: IntType<'ctx>, is_signed: bool) -> Self[src]

pub fn const_shl(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_rshr(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_ashr(self, rhs: IntValue<'ctx>) -> Self[src]

pub fn const_unsigned_to_float(
    self,
    float_type: FloatType<'ctx>
) -> FloatValue<'ctx>
[src]

pub fn const_signed_to_float(
    self,
    float_type: FloatType<'ctx>
) -> FloatValue<'ctx>
[src]

pub fn const_to_pointer(self, ptr_type: PointerType<'ctx>) -> PointerValue<'ctx>[src]

pub fn const_truncate(self, int_type: IntType<'ctx>) -> IntValue<'ctx>[src]

pub fn const_s_extend(self, int_type: IntType<'ctx>) -> IntValue<'ctx>[src]

pub fn const_z_ext(self, int_type: IntType<'ctx>) -> IntValue<'ctx>[src]

pub fn const_truncate_or_bit_cast(
    self,
    int_type: IntType<'ctx>
) -> IntValue<'ctx>
[src]

pub fn const_s_extend_or_bit_cast(
    self,
    int_type: IntType<'ctx>
) -> IntValue<'ctx>
[src]

pub fn const_z_ext_or_bit_cast(self, int_type: IntType<'ctx>) -> IntValue<'ctx>[src]

pub fn const_bit_cast(self, int_type: IntType<'_>) -> IntValue<'ctx>[src]

pub fn const_int_compare(
    self,
    op: IntPredicate,
    rhs: IntValue<'ctx>
) -> IntValue<'ctx>
[src]

pub fn const_select<BV: BasicValue<'ctx>>(
    self,
    then: BV,
    else_: BV
) -> BasicValueEnum<'ctx>
[src]

pub fn is_const(self) -> bool[src]

Determines whether or not an IntValue is an llvm::Constant.

Constants includes values that are not known at compile time, for example the address of a function casted to an integer.

Example

use inkwell::context::Context;

let context = Context::create();
let i64_type = context.i64_type();
let i64_val = i64_type.const_int(12, false);

assert!(i64_val.is_const());

pub fn is_constant_int(self) -> bool[src]

Determines whether or not an IntValue is an llvm::ConstantInt.

ConstantInt only includes values that are known at compile time.

Example

use inkwell::context::Context;

let context = Context::create();
let i64_type = context.i64_type();
let i64_val = i64_type.const_int(12, false);

assert!(i64_val.is_constant_int());

pub fn get_zero_extended_constant(self) -> Option<u64>[src]

Obtains a constant IntValue's zero extended value.

Example

use inkwell::context::Context;

let context = Context::create();
let i8_type = context.i8_type();
let i8_all_ones = i8_type.const_all_ones();

assert_eq!(i8_all_ones.get_zero_extended_constant(), Some(255));

pub fn get_sign_extended_constant(self) -> Option<i64>[src]

Obtains a constant IntValue's sign extended value.

Example

use inkwell::context::Context;

let context = Context::create();
let i8_type = context.i8_type();
let i8_all_ones = i8_type.const_all_ones();

assert_eq!(i8_all_ones.get_sign_extended_constant(), Some(-1));

pub fn replace_all_uses_with(self, other: IntValue<'ctx>)[src]

Trait Implementations

impl<'ctx> AnyValue<'ctx> for IntValue<'ctx>[src]

impl<'ctx> BasicValue<'ctx> for IntValue<'ctx>[src]

impl<'ctx> Clone for IntValue<'ctx>[src]

impl<'ctx> Copy for IntValue<'ctx>[src]

impl<'ctx> Debug for IntValue<'ctx>[src]

impl<'ctx> Eq for IntValue<'ctx>[src]

impl<'ctx> From<IntValue<'ctx>> for AnyValueEnum<'ctx>[src]

impl<'ctx> From<IntValue<'ctx>> for BasicValueEnum<'ctx>[src]

impl<'ctx> From<IntValue<'ctx>> for BasicMetadataValueEnum<'ctx>[src]

impl<'ctx> Hash for IntValue<'ctx>[src]

impl<'ctx> IntMathValue<'ctx> for IntValue<'ctx>[src]

type BaseType = IntType<'ctx>

impl<'ctx> PartialEq<AnyValueEnum<'ctx>> for IntValue<'ctx>[src]

impl<'ctx> PartialEq<BasicMetadataValueEnum<'ctx>> for IntValue<'ctx>[src]

impl<'ctx> PartialEq<BasicValueEnum<'ctx>> for IntValue<'ctx>[src]

impl<'ctx> PartialEq<IntValue<'ctx>> for AnyValueEnum<'ctx>[src]

impl<'ctx> PartialEq<IntValue<'ctx>> for BasicValueEnum<'ctx>[src]

impl<'ctx> PartialEq<IntValue<'ctx>> for BasicMetadataValueEnum<'ctx>[src]

impl<'ctx> PartialEq<IntValue<'ctx>> for IntValue<'ctx>[src]

impl<'ctx> StructuralEq for IntValue<'ctx>[src]

impl<'ctx> StructuralPartialEq for IntValue<'ctx>[src]

impl<'ctx> TryFrom<AnyValueEnum<'ctx>> for IntValue<'ctx>[src]

type Error = ()

The type returned in the event of a conversion error.

impl<'ctx> TryFrom<BasicMetadataValueEnum<'ctx>> for IntValue<'ctx>[src]

type Error = ()

The type returned in the event of a conversion error.

impl<'ctx> TryFrom<BasicValueEnum<'ctx>> for IntValue<'ctx>[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'ctx> RefUnwindSafe for IntValue<'ctx>

impl<'ctx> !Send for IntValue<'ctx>

impl<'ctx> !Sync for IntValue<'ctx>

impl<'ctx> Unpin for IntValue<'ctx>

impl<'ctx> UnwindSafe for IntValue<'ctx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.