Struct RValue

Source
pub struct RValue<'ctx> { /* private fields */ }
Expand description

An RValue is a value that may or may not have a storage address in gccjit. RValues can be dereferenced, used for field accesses, and are the parameters given to a majority of the gccjit API calls.

Implementations§

Source§

impl<'ctx> RValue<'ctx>

Source

pub fn get_type(&self) -> Type<'ctx>

Gets the type of this RValue.

Source

pub fn set_location(&self, loc: Location<'_>)

Sets the location of this RValue.

Source

pub fn set_type(&self, typ: Type<'ctx>)

Change the type of this RValue.

Source

pub fn access_field( &self, loc: Option<Location<'ctx>>, field: Field<'ctx>, ) -> RValue<'ctx>

Given an RValue x and a Field f, returns an RValue representing C’s x.f.

Source

pub fn dereference_field( &self, loc: Option<Location<'ctx>>, field: Field<'ctx>, ) -> LValue<'ctx>

Given an RValue x and a Field f, returns an LValue representing C’s x->f.

Source

pub fn dereference(&self, loc: Option<Location<'ctx>>) -> LValue<'ctx>

Given a RValue x, returns an RValue that represents *x.

Trait Implementations§

Source§

impl<'ctx> Add for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the + operation. Read more
Source§

impl<'ctx> BitAnd for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the & operation. Read more
Source§

impl<'ctx> BitOr for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the | operation. Read more
Source§

impl<'ctx> BitXor for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the ^ operation. Read more
Source§

impl<'ctx> Clone for RValue<'ctx>

Source§

fn clone(&self) -> RValue<'ctx>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'ctx> Debug for RValue<'ctx>

Source§

fn fmt<'a>(&self, fmt: &mut Formatter<'a>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'ctx> Div for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the / operation. Read more
Source§

impl<'ctx> Hash for RValue<'ctx>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'ctx> Mul for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the * operation. Read more
Source§

impl<'ctx> PartialEq for RValue<'ctx>

Source§

fn eq(&self, other: &RValue<'ctx>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'ctx> Rem for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the % operation. Read more
Source§

impl<'ctx> Shl for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the << operation. Read more
Source§

impl<'ctx> Shr for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the >> operation. Read more
Source§

impl<'ctx> Sub for RValue<'ctx>

Source§

type Output = RValue<'ctx>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: RValue<'ctx>) -> RValue<'ctx>

Performs the - operation. Read more
Source§

impl<'ctx> ToObject<'ctx> for RValue<'ctx>

Source§

fn to_object(&self) -> Object<'ctx>

Source§

impl<'ctx> ToRValue<'ctx> for RValue<'ctx>

Source§

fn to_rvalue(&self) -> RValue<'ctx>

Source§

impl<'ctx> Copy for RValue<'ctx>

Source§

impl<'ctx> Eq for RValue<'ctx>

Source§

impl<'ctx> StructuralPartialEq for RValue<'ctx>

Auto Trait Implementations§

§

impl<'ctx> Freeze for RValue<'ctx>

§

impl<'ctx> RefUnwindSafe for RValue<'ctx>

§

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

§

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

§

impl<'ctx> Unpin for RValue<'ctx>

§

impl<'ctx> UnwindSafe for RValue<'ctx>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.