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 more