Enum llvm_lib::core::UnnamedAddr
source · pub enum UnnamedAddr {
NoUnnamedAddr,
LocalUnnamedAddr,
GlobalUnnamedAddr,
}
Expand description
Represents the unnamed address attribute for global values in LLVM.
UnnamedAddr
is an enumeration that specifies whether a global variable or function’s address is significant.
This can help LLVM’s optimizer determine whether it can merge or duplicate global values with identical content,
potentially reducing code size or improving performance.
Variants§
NoUnnamedAddr
NoUnnamedAddr
: The address of the global value is significant, and it must be unique.
The global variable or function cannot be merged with others, even if they have the same content.
This is the default behavior for most global values.
LocalUnnamedAddr
LocalUnnamedAddr
: The address of the global value is not significant within the module, allowing the optimizer
to merge or duplicate global values with the same content. However, the address is still unique within the module.
This is useful for variables or functions that are only accessed within the same module and do not need a unique address.
GlobalUnnamedAddr
GlobalUnnamedAddr
: The address of the global value is not significant across the entire program, allowing the optimizer
to freely merge or duplicate global values with identical content across different modules.
This can lead to more aggressive optimizations and is useful for constants or functions that do not rely on having a unique address.
Trait Implementations§
source§impl Clone for UnnamedAddr
impl Clone for UnnamedAddr
source§fn clone(&self) -> UnnamedAddr
fn clone(&self) -> UnnamedAddr
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UnnamedAddr
impl Debug for UnnamedAddr
source§impl From<LLVMUnnamedAddr> for UnnamedAddr
impl From<LLVMUnnamedAddr> for UnnamedAddr
source§fn from(unnamed_addr: LLVMUnnamedAddr) -> Self
fn from(unnamed_addr: LLVMUnnamedAddr) -> Self
source§impl From<UnnamedAddr> for LLVMUnnamedAddr
impl From<UnnamedAddr> for LLVMUnnamedAddr
source§fn from(unnamed_addr: UnnamedAddr) -> Self
fn from(unnamed_addr: UnnamedAddr) -> Self
source§impl PartialEq for UnnamedAddr
impl PartialEq for UnnamedAddr
impl Copy for UnnamedAddr
impl Eq for UnnamedAddr
impl StructuralPartialEq for UnnamedAddr
Auto Trait Implementations§
impl Freeze for UnnamedAddr
impl RefUnwindSafe for UnnamedAddr
impl Send for UnnamedAddr
impl Sync for UnnamedAddr
impl Unpin for UnnamedAddr
impl UnwindSafe for UnnamedAddr
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)