Metadata

LLVM.MDStringMethod
MDString(val::String)

Create a new string metadata node from the given Julia string.

source
Base.convertMethod
convert(String, md::MDString)

Get the string value of the given string metadata node.

source
LLVM.MDNodeType
MDNode

Abstract supertype for metadata nodes that can have operands.

See also: MDTuple for a concrete subtype.

source
LLVM.MDNodeMethod
MDNode(vals::Vector) -> MDTuple

Create a new tuple metadata node from the given operands.

Passing nothing as a value will result in a null operand.

source

Metadata <-> Value

LLVM.MetadataMethod
Metadata(val::Value)

Wrap the given value as metadata, for use in APIs that expect a LLVM.Metadata.

When the value is already metadata wrapped as a value, this will simply return the original metadata.

source
LLVM.ValueMethod
Value(md::Metadata)

Wrap the given metadata as a value, for use in APIs that expect a LLVM.Value.

When the metadata is already a value wrapped as metadata, this will simply return the original value.

source

Inspecting and attaching

LLVM.metadataMethod
metadata(inst::Instruction)
metadata(inst::GlobalObject)

Iterate over the metadata of the given instruction or global object.

These iterators are mutable, and implement setindex! and delete! to modify the metadata.

source
LLVM.NamedMDNodeType
NamedMDNode

A named metadata node, which is a collection of metadata nodes with a name.

source
LLVM.metadataMethod
metadata(mod)

Fetch the module-level named metadata. This can be inspected using a Dict-like interface. Mutation is different: There is no setindex! method, as named metadata is append-only. Instead, fetch the named metadata node using getindex, and push! to it.

source
LLVM.nameMethod
name(node::NamedMDNode)

Get the name of the given named metadata node.

source
LLVM.operandsMethod
operands(node::NamedMDNode)

Get the operands of the given named metadata node.

source
Base.push!Method
push!(node::NamedMDNode, val::MDNode)

Add a metadata node to the given named metadata node.

source

Debug information

Location information

LLVM.lineMethod
line(location::DILocation)

Get the line number of this debug location.

source
LLVM.columnFunction
column(location::DILocation)

Get the column number of this debug location.

source
LLVM.scopeMethod
scope(location::DILocation)

Get the local scope associated with this debug location.

source
LLVM.inlined_atFunction
inlined_at(location::DILocation)

Get the "inline at" location associated with this debug location.

source

Variables

LLVM.fileMethod
file(var::DIVariable)

Get the file of the given variable.

source
LLVM.scopeMethod
name(var::DIVariable)

Get the name of the given variable.

source
LLVM.lineMethod
line(var::DIVariable)

Get the line number of the given variable.

source

Scopes

LLVM.DIScopeType
DIScope

Abstract supertype for lexical scopes and types (which are also declaration contexts).

source
LLVM.fileMethod
file(scope::DIScope)

Get the metadata of the file associated with a given scope.

source
LLVM.nameMethod
name(scope::DIScope)

Get the name of the given scope.

source

File

LLVM.sourceFunction
source(file::DIFile)

Get the source of the given file, or nothing if the source is not available.

source

Type

Base.sizeofMethod
sizeof(typ::DIType)

Get the size in bits of the given type.

source
LLVM.offsetMethod
offset(typ::DIType)

Get the offset in bits of the given type.

source
LLVM.lineMethod
line(typ::DIType)

Get the line number of the given type.

source

Subprogram

LLVM.lineMethod
line(subprogram::DISubProgram)

Get the line number of the given subprogram.

source

Compile Unit

Other

LLVM.subprogramMethod
subprogram(func::Function) -> DISubProgram

Get the subprogram of the given function, or nothing if the function has no subprogram.

source
LLVM.subprogram!Function
subprogram!(func::Function, sp::DISubProgram)

Set the subprogram of the given function.

source