pub struct GetElementPtrOp { /* private fields */ }Expand description
Equivalent to LLVM’s GetElementPtr.
§Operands
| operand | description |
|---|---|
base | LLVM pointer type |
dynamicIndices | Any number of signless integers |
§Result(s):
| result | description |
|---|---|
res | LLVM pointer type |
§Attribute(s):
Note: Only attributes defined directly as part of this operation are listed here. There may be others, not listed here, defined by interface implementations.
| Name | Static Name Identifier | Type |
|---|---|---|
llvm_gep_src_elem_type | ATTR_KEY_LLVM_GEP_SRC_ELEM_TYPE | [TypeAttr] |
llvm_gep_indices | ATTR_KEY_LLVM_GEP_INDICES | GepIndicesAttr |
llvm_gep_no_wrap_flags | ATTR_KEY_LLVM_GEP_NO_WRAP_FLAGS | GepNoWrapFlagsAttr |
Implementations§
Source§impl GetElementPtrOp
impl GetElementPtrOp
pub fn get_operand_src_ptr(&self, ctx: &Context) -> Value
pub fn get_operand_dynamic_indices(&self, ctx: &Context) -> Value
Source§impl GetElementPtrOp
impl GetElementPtrOp
Sourcepub fn get_attr_llvm_gep_src_elem_type<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, TypeAttr>>
pub fn get_attr_llvm_gep_src_elem_type<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, TypeAttr>>
Get a Ref to the value of the attribute named llvm_gep_src_elem_type.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_gep_src_elem_type(&self, ctx: &Context, value: TypeAttr)
pub fn set_attr_llvm_gep_src_elem_type(&self, ctx: &Context, value: TypeAttr)
Set the value of the attribute named llvm_gep_src_elem_type.
Sourcepub fn get_attr_llvm_gep_indices<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, GepIndicesAttr>>
pub fn get_attr_llvm_gep_indices<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, GepIndicesAttr>>
Get a Ref to the value of the attribute named llvm_gep_indices.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_gep_indices(&self, ctx: &Context, value: GepIndicesAttr)
pub fn set_attr_llvm_gep_indices(&self, ctx: &Context, value: GepIndicesAttr)
Set the value of the attribute named llvm_gep_indices.
Sourcepub fn get_attr_llvm_gep_no_wrap_flags<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, GepNoWrapFlagsAttr>>
pub fn get_attr_llvm_gep_no_wrap_flags<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, GepNoWrapFlagsAttr>>
Get a Ref to the value of the attribute named llvm_gep_no_wrap_flags.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_gep_no_wrap_flags(
&self,
ctx: &Context,
value: GepNoWrapFlagsAttr,
)
pub fn set_attr_llvm_gep_no_wrap_flags( &self, ctx: &Context, value: GepNoWrapFlagsAttr, )
Set the value of the attribute named llvm_gep_no_wrap_flags.
Source§impl GetElementPtrOp
impl GetElementPtrOp
Sourcepub fn new(
ctx: &mut Context,
base: Value,
indices: Vec<GepIndex>,
src_elem_type: TypeHandle,
) -> Self
pub fn new( ctx: &mut Context, base: Value, indices: Vec<GepIndex>, src_elem_type: TypeHandle, ) -> Self
Create a new GetElementPtrOp
Sourcepub fn new_with_no_wrap_flags(
ctx: &mut Context,
base: Value,
indices: Vec<GepIndex>,
src_elem_type: TypeHandle,
no_wrap_flags: GepNoWrapFlags,
) -> Self
pub fn new_with_no_wrap_flags( ctx: &mut Context, base: Value, indices: Vec<GepIndex>, src_elem_type: TypeHandle, no_wrap_flags: GepNoWrapFlags, ) -> Self
Create a new GetElementPtrOp with LLVM no-wrap flags.
Sourcepub fn no_wrap_flags(&self, ctx: &Context) -> GepNoWrapFlags
pub fn no_wrap_flags(&self, ctx: &Context) -> GepNoWrapFlags
Get the GEP no-wrap flags.
Sourcepub fn src_elem_type(&self, ctx: &Context) -> TypeHandle
pub fn src_elem_type(&self, ctx: &Context) -> TypeHandle
Get the source pointer’s element type.
Sourcepub fn indexed_type(
ctx: &Context,
src_elem_type: TypeHandle,
indices: &[GepIndex],
) -> Result<TypeHandle>
pub fn indexed_type( ctx: &Context, src_elem_type: TypeHandle, indices: &[GepIndex], ) -> Result<TypeHandle>
Returns the result element type of a GEP with the given source element type and indexes. See getIndexedType
Trait Implementations§
Source§impl Clone for GetElementPtrOp
impl Clone for GetElementPtrOp
Source§fn clone(&self) -> GetElementPtrOp
fn clone(&self) -> GetElementPtrOp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GetElementPtrOp
impl Eq for GetElementPtrOp
Source§impl Hash for GetElementPtrOp
impl Hash for GetElementPtrOp
Source§impl OneResultInterface for GetElementPtrOp
impl OneResultInterface for GetElementPtrOp
§fn get_result(&self, ctx: &Context) -> Value
fn get_result(&self, ctx: &Context) -> Value
§fn result_type(&self, ctx: &Context) -> TypeHandle
fn result_type(&self, ctx: &Context) -> TypeHandle
Source§impl Op for GetElementPtrOp
impl Op for GetElementPtrOp
Source§fn get_operation(&self) -> Ptr<Operation>
fn get_operation(&self) -> Ptr<Operation>
Source§fn get_opid_static() -> OpId
fn get_opid_static() -> OpId
§fn get_concrete_op_info() -> (fn(Ptr<Operation>) -> OpBox, TypeId)where
Self: Sized,
fn get_concrete_op_info() -> (fn(Ptr<Operation>) -> OpBox, TypeId)where
Self: Sized,
Source§impl Parsable for GetElementPtrOp
impl Parsable for GetElementPtrOp
Source§type Arg = Vec<(Identifier, Location)>
type Arg = Vec<(Identifier, Location)>
Source§fn parse<'__pliron_parse>(
state_stream: &mut StateStream<'__pliron_parse>,
arg: Self::Arg,
) -> ParseResult<'__pliron_parse, Self::Parsed>
fn parse<'__pliron_parse>( state_stream: &mut StateStream<'__pliron_parse>, arg: Self::Arg, ) -> ParseResult<'__pliron_parse, Self::Parsed>
into on [Parser::parse_stream] to get the final [ParseResult].
Use state_stream.state as necessary.Source§impl PartialEq for GetElementPtrOp
impl PartialEq for GetElementPtrOp
Source§fn eq(&self, other: &GetElementPtrOp) -> bool
fn eq(&self, other: &GetElementPtrOp) -> bool
self and other values to be equal, and is used by ==.Source§impl PointerTypeResult for GetElementPtrOp
impl PointerTypeResult for GetElementPtrOp
Source§fn result_pointee_type(&self, ctx: &Context) -> TypeHandle
fn result_pointee_type(&self, ctx: &Context) -> TypeHandle
Source§impl Printable for GetElementPtrOp
impl Printable for GetElementPtrOp
impl ResultNOfType<0, PointerType> for GetElementPtrOp
Source§impl SideEffects for GetElementPtrOp
impl SideEffects for GetElementPtrOp
Source§fn has_side_effects(&self, _ctx: &Context) -> bool
fn has_side_effects(&self, _ctx: &Context) -> bool
true if the operation has side effects, and false otherwise.impl StructuralPartialEq for GetElementPtrOp
Auto Trait Implementations§
impl !RefUnwindSafe for GetElementPtrOp
impl !UnwindSafe for GetElementPtrOp
impl Freeze for GetElementPtrOp
impl Send for GetElementPtrOp
impl Sync for GetElementPtrOp
impl Unpin for GetElementPtrOp
impl UnsafeUnpin for GetElementPtrOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.