pub struct GlobalOp { /* private fields */ }Expand description
Same as MLIR’s LLVM dialect GlobalOp It creates a global variable of the specified LLVM IR dialect type. An initializer can be specified either as an attribute or in the operation’s initializer region, ending with a return.
§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_global_type | ATTR_KEY_LLVM_GLOBAL_TYPE | TypeAttr |
global_initializer | ATTR_KEY_GLOBAL_INITIALIZER | Any |
llvm_global_linkage | ATTR_KEY_LLVM_GLOBAL_LINKAGE | LinkageAttr |
Implementations§
Source§impl GlobalOp
impl GlobalOp
Sourcepub fn get_attr_llvm_global_type<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, TypeAttr>>
pub fn get_attr_llvm_global_type<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, TypeAttr>>
Get a Ref to the value of the attribute named llvm_global_type.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_global_type(&self, ctx: &Context, value: TypeAttr)
pub fn set_attr_llvm_global_type(&self, ctx: &Context, value: TypeAttr)
Set the value of the attribute named llvm_global_type.
Sourcepub fn get_attr_global_initializer<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, AttrObj>>
pub fn get_attr_global_initializer<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, AttrObj>>
Get a Ref to the value of the attribute named global_initializer.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_global_initializer(&self, ctx: &Context, value: AttrObj)
pub fn set_attr_global_initializer(&self, ctx: &Context, value: AttrObj)
Set the value of the attribute named global_initializer.
Sourcepub fn get_attr_llvm_global_linkage<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, LinkageAttr>>
pub fn get_attr_llvm_global_linkage<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, LinkageAttr>>
Get a Ref to the value of the attribute named llvm_global_linkage.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_global_linkage(&self, ctx: &Context, value: LinkageAttr)
pub fn set_attr_llvm_global_linkage(&self, ctx: &Context, value: LinkageAttr)
Set the value of the attribute named llvm_global_linkage.
Source§impl GlobalOp
impl GlobalOp
Sourcepub fn get_initializer_value(&self, ctx: &Context) -> Option<AttrObj>
pub fn get_initializer_value(&self, ctx: &Context) -> Option<AttrObj>
Get the initializer value of this global variable.
Sourcepub fn get_initializer_block(&self, ctx: &Context) -> Option<Ptr<BasicBlock>>
pub fn get_initializer_block(&self, ctx: &Context) -> Option<Ptr<BasicBlock>>
Get the initializer region’s block of this global variable. This is a block that ends with a return operation. The return operation must have the same type as the global variable.
Sourcepub fn get_initializer_region(&self, ctx: &Context) -> Option<Ptr<Region>>
pub fn get_initializer_region(&self, ctx: &Context) -> Option<Ptr<Region>>
Get the initializer region of this global variable.
Sourcepub fn set_initializer_value(&self, ctx: &Context, value: AttrObj)
pub fn set_initializer_value(&self, ctx: &Context, value: AttrObj)
Set a simple initializer value for this global variable.
Sourcepub fn add_initializer_region(&self, ctx: &mut Context) -> Ptr<Region>
pub fn add_initializer_region(&self, ctx: &mut Context) -> Ptr<Region>
Add an initializer region (with an entry block) for this global variable. There shouldn’t already be one.
Trait Implementations§
Source§impl AlignableOpInterface for GlobalOp
impl AlignableOpInterface for GlobalOp
Source§impl IsDeclaration for GlobalOp
impl IsDeclaration for GlobalOp
Source§fn is_declaration(&self, ctx: &Context) -> bool
fn is_declaration(&self, ctx: &Context) -> bool
Source§impl LlvmSymbolName for GlobalOp
impl LlvmSymbolName for GlobalOp
Source§impl Op for GlobalOp
impl Op for GlobalOp
Source§fn get_operation(&self) -> Ptr<Operation>
fn get_operation(&self) -> Ptr<Operation>
Source§fn get_opid_static() -> OpId
fn get_opid_static() -> OpId
Source§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 GlobalOp
impl Parsable for GlobalOp
Source§type Arg = Vec<(Identifier, Location)>
type Arg = Vec<(Identifier, Location)>
Source§fn parse<'a>(
state_stream: &mut StateStream<'a>,
results: Self::Arg,
) -> ParseResult<'a, Self::Parsed>
fn parse<'a>( state_stream: &mut StateStream<'a>, results: Self::Arg, ) -> ParseResult<'a, Self::Parsed>
into on [Parser::parse_stream] to get the final ParseResult.
Use state_stream.state as necessary.Source§fn parser<'a>(
arg: Self::Arg,
) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>
fn parser<'a>( arg: Self::Arg, ) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>
Source§impl Printable for GlobalOp
impl Printable for GlobalOp
Source§impl SymbolOpInterface for GlobalOp
impl SymbolOpInterface for GlobalOp
Source§fn get_symbol_name(&self, ctx: &Context) -> Identifier
fn get_symbol_name(&self, ctx: &Context) -> Identifier
Source§fn set_symbol_name(&self, ctx: &mut Context, name: Identifier)
fn set_symbol_name(&self, ctx: &mut Context, name: Identifier)
impl Copy for GlobalOp
impl Eq for GlobalOp
impl IsolatedFromAboveInterface for GlobalOp
impl NOpdsInterface<0> for GlobalOp
impl NResultsInterface<0> for GlobalOp
impl StructuralPartialEq for GlobalOp
Auto Trait Implementations§
impl Freeze for GlobalOp
impl !RefUnwindSafe for GlobalOp
impl Send for GlobalOp
impl Sync for GlobalOp
impl Unpin for GlobalOp
impl UnsafeUnpin for GlobalOp
impl !UnwindSafe for GlobalOp
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.