Enum llvm_rs::value::Linkage

source ·
#[repr(C)]
pub enum Linkage {
    External,
    AvailableExternally,
    LinkOnceAny,
    LinkOnceODR,
    WeakAny,
    WeakODR,
    Appending,
    Internal,
    Private,
    ExternalWeak,
    Common,
}
Expand description

A way of indicating to LLVM how you want a global to interact during linkage.

Variants§

§

External

Default linkage. The global is externally visible and participates in linkage normally.

§

AvailableExternally

Never emitted to the containing module’s object file. Used to allow inlining and/or other optimisations to take place, given knowledge of the definition of the global, which is somewhere outside of the module. Otherwise the same as LinkOnceODR. Only allowed on definitions, not declarations.

§

LinkOnceAny

Merged with other globals of the same name during linkage. Unreferenced LinkOnce globals may be discarded.

§

LinkOnceODR

Similar to LinkOnceAny, but indicates that it will only be merged with equivalent globals.

§

WeakAny

Same merging semantics as LinkOnceAny. Unlike LinkOnce, unreference globals will not be discarded.

§

WeakODR

Similar to WeakAny, but indicates that it will only be merged with equivalent globals.

§

Appending

Only allowed on global array pointers. When two globals with Appending linkage are merged, they are appended together.

§

Internal

Similar to Private, but shows as a local symbol in the object file.

§

Private

Only directly accessible by objects in the current module. May be renamed as neccessary to avoid collisions, and all references will be updated. Will not show up in the object file’s symbol table.

§

ExternalWeak

Weak until linked. If not linked, the output symbol is null, instead of undefined.

§

Common

Similar to Weak, but may not have an explicit section, must have a zero initializer, and may not be marked constant. Cannot be used on functions or aliases.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.