pub struct GlobalVariable {
pub name: String,
pub value_type: ValueType,
pub variable_or_constant: bool,
pub initializer: Constant,
/* private fields */
}Fields§
§name: String§value_type: ValueType§variable_or_constant: boolTrue if the global variable is a global variable, false if it is a global constant.
initializer: ConstantImplementations§
Source§impl GlobalVariable
impl GlobalVariable
pub fn new( name: String, value_type: ValueType, variable_or_constant: bool, initializer: Constant, ) -> Self
pub fn gen_llvm_ir(&self) -> String
pub fn get_user(&self) -> &[InstPtr]
pub fn get_user_mut(&mut self) -> &mut Vec<InstPtr>
Sourcepub unsafe fn add_user(&mut self, inst: InstPtr)
pub unsafe fn add_user(&mut self, inst: InstPtr)
§Safety
FIXME: explain why it is unsafe,and describe the safety requirements
Sourcepub unsafe fn remove_user(&mut self, inst: InstPtr)
pub unsafe fn remove_user(&mut self, inst: InstPtr)
§Safety
FIXME: explain why it is unsafe,and describe the safety requirements
Trait Implementations§
Source§impl AsRef<GlobalVariable> for GlobalPtr
impl AsRef<GlobalVariable> for GlobalPtr
Source§fn as_ref(&self) -> &GlobalVariable
fn as_ref(&self) -> &GlobalVariable
Converts this type into a shared reference of the (usually inferred) input type.
Auto Trait Implementations§
impl Freeze for GlobalVariable
impl !RefUnwindSafe for GlobalVariable
impl !Send for GlobalVariable
impl !Sync for GlobalVariable
impl Unpin for GlobalVariable
impl !UnwindSafe for GlobalVariable
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