LLVM 22.0.0git

This group contains functions that operate on global values. More...

Collaboration diagram for Global Values:

Topics

 Values with alignment
 Functions in this group only apply to values with alignment, i.e.

Functions

LLVM_C_ABI LLVMModuleRef LLVMGetGlobalParent (LLVMValueRef Global)
LLVM_C_ABI LLVMBool LLVMIsDeclaration (LLVMValueRef Global)
LLVM_C_ABI LLVMLinkage LLVMGetLinkage (LLVMValueRef Global)
LLVM_C_ABI void LLVMSetLinkage (LLVMValueRef Global, LLVMLinkage Linkage)
LLVM_C_ABI const charLLVMGetSection (LLVMValueRef Global)
LLVM_C_ABI void LLVMSetSection (LLVMValueRef Global, const char *Section)
LLVM_C_ABI LLVMVisibility LLVMGetVisibility (LLVMValueRef Global)
LLVM_C_ABI void LLVMSetVisibility (LLVMValueRef Global, LLVMVisibility Viz)
LLVM_C_ABI LLVMDLLStorageClass LLVMGetDLLStorageClass (LLVMValueRef Global)
LLVM_C_ABI void LLVMSetDLLStorageClass (LLVMValueRef Global, LLVMDLLStorageClass Class)
LLVM_C_ABI LLVMUnnamedAddr LLVMGetUnnamedAddress (LLVMValueRef Global)
LLVM_C_ABI void LLVMSetUnnamedAddress (LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
LLVM_C_ABI LLVMTypeRef LLVMGlobalGetValueType (LLVMValueRef Global)
 Returns the "value type" of a global value.
LLVM_C_ABI LLVMBool LLVMHasUnnamedAddr (LLVMValueRef Global)
 Deprecated: Use LLVMGetUnnamedAddress instead.
LLVM_C_ABI void LLVMSetUnnamedAddr (LLVMValueRef Global, LLVMBool HasUnnamedAddr)
 Deprecated: Use LLVMSetUnnamedAddress instead.
LLVM_C_ABI unsigned LLVMGetAlignment (LLVMValueRef V)
 Obtain the preferred alignment of the value.
LLVM_C_ABI void LLVMSetAlignment (LLVMValueRef V, unsigned Bytes)
 Set the preferred alignment of the value.
LLVM_C_ABI void LLVMGlobalSetMetadata (LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
 Sets a metadata attachment, erasing the existing metadata attachment if it already exists for the given kind.
LLVM_C_ABI void LLVMGlobalAddMetadata (LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
 Adds a metadata attachment.
LLVM_C_ABI void LLVMGlobalEraseMetadata (LLVMValueRef Global, unsigned Kind)
 Erases a metadata attachment of the given kind if it exists.
LLVM_C_ABI void LLVMGlobalClearMetadata (LLVMValueRef Global)
 Removes all metadata attachments from this value.
LLVM_C_ABI void LLVMGlobalAddDebugInfo (LLVMValueRef Global, LLVMMetadataRef GVE)
 Add debuginfo metadata to this global.
LLVM_C_ABI LLVMValueMetadataEntryLLVMGlobalCopyAllMetadata (LLVMValueRef Value, size_t *NumEntries)
 Retrieves an array of metadata entries representing the metadata attached to this value.
LLVM_C_ABI void LLVMDisposeValueMetadataEntries (LLVMValueMetadataEntry *Entries)
 Destroys value metadata entries.
LLVM_C_ABI unsigned LLVMValueMetadataEntriesGetKind (LLVMValueMetadataEntry *Entries, unsigned Index)
 Returns the kind of a value metadata entry at a specific index.
LLVM_C_ABI LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata (LLVMValueMetadataEntry *Entries, unsigned Index)
 Returns the underlying metadata node of a value metadata entry at a specific index.

Detailed Description

This group contains functions that operate on global values.

Functions in this group relate to functions in the llvm::GlobalValue class tree.

See also
llvm::GlobalValue

Function Documentation

◆ LLVMDisposeValueMetadataEntries()

LLVM_C_ABI void LLVMDisposeValueMetadataEntries ( LLVMValueMetadataEntry * Entries)

Destroys value metadata entries.

Definition at line 2180 of file Core.cpp.

◆ LLVMGetAlignment()

LLVM_C_ABI unsigned LLVMGetAlignment ( LLVMValueRef V)

Obtain the preferred alignment of the value.

See also
llvm::AllocaInst::getAlignment()
llvm::LoadInst::getAlignment()
llvm::StoreInst::getAlignment()
llvm::AtomicRMWInst::setAlignment()
llvm::AtomicCmpXchgInst::setAlignment()
llvm::GlobalValue::getAlignment()

Definition at line 2109 of file Core.cpp.

References llvm::dyn_cast(), F, llvm_unreachable, P, and llvm::unwrap().

◆ LLVMGetDLLStorageClass()

LLVM_C_ABI LLVMDLLStorageClass LLVMGetDLLStorageClass ( LLVMValueRef Global)

Definition at line 2058 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMGetGlobalParent()

LLVM_C_ABI LLVMModuleRef LLVMGetGlobalParent ( LLVMValueRef Global)

Definition at line 1936 of file Core.cpp.

References getParent(), llvm::Global, llvm::unwrap(), and llvm::wrap().

◆ LLVMGetLinkage()

◆ LLVMGetSection()

LLVM_C_ABI const char * LLVMGetSection ( LLVMValueRef Global)

Definition at line 2038 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMGetUnnamedAddress()

◆ LLVMGetVisibility()

LLVM_C_ABI LLVMVisibility LLVMGetVisibility ( LLVMValueRef Global)

Definition at line 2048 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMGlobalAddDebugInfo()

LLVM_C_ABI void LLVMGlobalAddDebugInfo ( LLVMValueRef Global,
LLVMMetadataRef GVE )

Add debuginfo metadata to this global.

See also
llvm::GlobalVariable::addDebugInfo()

Definition at line 2202 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMGlobalAddMetadata()

LLVM_C_ABI void LLVMGlobalAddMetadata ( LLVMValueRef Global,
unsigned Kind,
LLVMMetadataRef MD )

Adds a metadata attachment.

See also
llvm::GlobalObject::addMetadata()

Definition at line 2189 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMGlobalClearMetadata()

LLVM_C_ABI void LLVMGlobalClearMetadata ( LLVMValueRef Global)

Removes all metadata attachments from this value.

See also
llvm::GlobalObject::clearMetadata()

Definition at line 2198 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMGlobalCopyAllMetadata()

LLVM_C_ABI LLVMValueMetadataEntry * LLVMGlobalCopyAllMetadata ( LLVMValueRef Value,
size_t * NumEntries )

Retrieves an array of metadata entries representing the metadata attached to this value.

The caller is responsible for freeing this array by calling LLVMDisposeValueMetadataEntries.

See also
llvm::GlobalObject::getAllMetadata()

Definition at line 2153 of file Core.cpp.

References llvm::SmallVectorImpl< T >::clear(), llvm::dyn_cast(), llvm_getMetadata(), and llvm::unwrap().

◆ LLVMGlobalEraseMetadata()

LLVM_C_ABI void LLVMGlobalEraseMetadata ( LLVMValueRef Global,
unsigned Kind )

Erases a metadata attachment of the given kind if it exists.

See also
llvm::GlobalObject::eraseMetadata()

Definition at line 2194 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMGlobalGetValueType()

LLVM_C_ABI LLVMTypeRef LLVMGlobalGetValueType ( LLVMValueRef Global)

Returns the "value type" of a global value.

This differs from the formal type of a global value which is always a pointer type.

See also
llvm::GlobalValue::getValueType()
llvm::Function::getFunctionType()

Definition at line 2103 of file Core.cpp.

References getValueType(), llvm::Global, llvm::unwrap(), and llvm::wrap().

◆ LLVMGlobalSetMetadata()

LLVM_C_ABI void LLVMGlobalSetMetadata ( LLVMValueRef Global,
unsigned Kind,
LLVMMetadataRef MD )

Sets a metadata attachment, erasing the existing metadata attachment if it already exists for the given kind.

See also
llvm::GlobalObject::setMetadata()

Definition at line 2184 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMHasUnnamedAddr()

LLVM_C_ABI LLVMBool LLVMHasUnnamedAddr ( LLVMValueRef Global)

Deprecated: Use LLVMGetUnnamedAddress instead.

Definition at line 2093 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMIsDeclaration()

LLVM_C_ABI LLVMBool LLVMIsDeclaration ( LLVMValueRef Global)

Definition at line 1940 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMSetAlignment()

LLVM_C_ABI void LLVMSetAlignment ( LLVMValueRef V,
unsigned Bytes )

◆ LLVMSetDLLStorageClass()

LLVM_C_ABI void LLVMSetDLLStorageClass ( LLVMValueRef Global,
LLVMDLLStorageClass Class )

Definition at line 2063 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMSetLinkage()

◆ LLVMSetSection()

LLVM_C_ABI void LLVMSetSection ( LLVMValueRef Global,
const char * Section )

Definition at line 2044 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMSetUnnamedAddr()

LLVM_C_ABI void LLVMSetUnnamedAddr ( LLVMValueRef Global,
LLVMBool HasUnnamedAddr )

Deprecated: Use LLVMSetUnnamedAddress instead.

Definition at line 2097 of file Core.cpp.

References llvm::Global, llvm::GlobalValue::Global, llvm::GlobalValue::None, and llvm::unwrap().

◆ LLVMSetUnnamedAddress()

◆ LLVMSetVisibility()

LLVM_C_ABI void LLVMSetVisibility ( LLVMValueRef Global,
LLVMVisibility Viz )

Definition at line 2053 of file Core.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMValueMetadataEntriesGetKind()

LLVM_C_ABI unsigned LLVMValueMetadataEntriesGetKind ( LLVMValueMetadataEntry * Entries,
unsigned Index )

Returns the kind of a value metadata entry at a specific index.

Definition at line 2165 of file Core.cpp.

References LLVMOpaqueValueMetadataEntry::Kind.

◆ LLVMValueMetadataEntriesGetMetadata()

LLVM_C_ABI LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata ( LLVMValueMetadataEntry * Entries,
unsigned Index )

Returns the underlying metadata node of a value metadata entry at a specific index.

Definition at line 2173 of file Core.cpp.

References LLVMOpaqueValueMetadataEntry::Metadata.