pub enum Linkage {
Show 17 variants
ExternalLinkage,
AvailableExternallyLinkage,
LinkOnceAnyLinkage,
LinkOnceODRLinkage,
LinkOnceODRAutoHideLinkage,
WeakAnyLinkage,
WeakODRLinkage,
AppendingLinkage,
InternalLinkage,
PrivateLinkage,
DLLImportLinkage,
DLLExportLinkage,
ExternalWeakLinkage,
GhostLinkage,
CommonLinkage,
LinkerPrivateLinkage,
LinkerPrivateWeakLinkage,
}
Expand description
Represents the linkage types in LLVM for global values. Linkage types determine the visibility and behavior of symbols across different modules and within the same module.
Variants§
ExternalLinkage
Externally visible function or variable. Can be linked from another module.
AvailableExternallyLinkage
Similar to ExternalLinkage
, but the symbol may be discarded if not used.
LinkOnceAnyLinkage
Keeps one copy of the function or variable when linking, discarding others.
LinkOnceODRLinkage
Similar to LinkOnceAnyLinkage
, but the symbol cannot be discarded.
LinkOnceODRAutoHideLinkage
Same as LinkOnceODRLinkage
, but with hidden visibility.
WeakAnyLinkage
Keeps one copy, discarding others, but prefer the local copy.
WeakODRLinkage
Similar to WeakAnyLinkage
, but ensures that the symbol is unique and is emitted only once.
AppendingLinkage
Appending linkage: when linked, multiple definitions of the same variable are concatenated.
InternalLinkage
Local to the translation unit, not visible outside of it.
PrivateLinkage
Similar to InternalLinkage
, but prevents inlining and other optimizations.
DLLImportLinkage
Indicates that the global value should be imported from a DLL.
DLLExportLinkage
Indicates that the global value should be exported to a DLL.
ExternalWeakLinkage
The global variable or function is merged into the program only if it is used.
GhostLinkage
A special linkage type used internally by the linker.
CommonLinkage
Common linkage for uninitialized global variables.
LinkerPrivateLinkage
Linker private linkage, used to indicate a symbol that is internal to the module.
LinkerPrivateWeakLinkage
Weak version of LinkerPrivateLinkage
.