Metadata
LLVM.Metadata
— TypeMetadata
Abstract supertype for all metadata types.
LLVM.MDString
— TypeMDString
A string metadata node.
LLVM.MDString
— MethodMDString(val::String)
Create a new string metadata node from the given Julia string.
Base.convert
— Methodconvert(String, md::MDString)
Get the string value of the given string metadata node.
LLVM.MDNode
— TypeMDNode
Abstract supertype for metadata nodes that can have operands.
See also: MDTuple
for a concrete subtype.
LLVM.operands
— Methodoperands(md::MDNode)
Get the operands of the given metadata node.
LLVM.MDTuple
— TypeMDTuple
A tuple metadata node.
LLVM.MDNode
— MethodMDNode(vals::Vector) -> MDTuple
Create a new tuple metadata node from the given operands.
Passing nothing
as a value will result in a null operand.
Metadata <-> Value
LLVM.ValueAsMetadata
— TypeLLVM.ValueAsMetadata
Abstract type for values wrapped as metadata, for use in APIs that expect a LLVM.Metadata
.
See also: Metadata(::Value)
to convert back to a metadata.
LLVM.Metadata
— MethodMetadata(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.
LLVM.MetadataAsValue
— TypeLLVM.MetadataAsValue
Metadata wrapped as a regular value, for use in APIs that expect a LLVM.Value
.
See also: Value(::Metadata)
to convert back to a value.
LLVM.Value
— MethodValue(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.
Inspecting and attaching
LLVM.metadata
— Methodmetadata(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.
LLVM.NamedMDNode
— TypeNamedMDNode
A named metadata node, which is a collection of metadata nodes with a name.
LLVM.metadata
— Methodmetadata(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.
LLVM.name
— Methodname(node::NamedMDNode)
Get the name of the given named metadata node.
LLVM.operands
— Methodoperands(node::NamedMDNode)
Get the operands of the given named metadata node.
Base.push!
— Methodpush!(node::NamedMDNode, val::MDNode)
Add a metadata node to the given named metadata node.
Debug information
LLVM.DINode
— TypeDINode
a tagged DWARF-like metadata node.
Location information
LLVM.DILocation
— TypeDILocation
A location in the source code.
LLVM.line
— Methodline(location::DILocation)
Get the line number of this debug location.
LLVM.column
— Functioncolumn(location::DILocation)
Get the column number of this debug location.
LLVM.scope
— Methodscope(location::DILocation)
Get the local scope associated with this debug location.
LLVM.inlined_at
— Functioninlined_at(location::DILocation)
Get the "inline at" location associated with this debug location.
Variables
LLVM.DIVariable
— TypeDIVariable
Abstract supertype for all variable-like metadata nodes.
LLVM.DILocalVariable
— TypeDILocalVariable <: DIVariable
A local variable in the source code.
LLVM.DIGlobalVariable
— TypeDIGlobalVariable <: DIVariable
A global variable in the source code.
LLVM.file
— Methodfile(var::DIVariable)
Get the file of the given variable.
LLVM.scope
— Methodname(var::DIVariable)
Get the name of the given variable.
LLVM.line
— Methodline(var::DIVariable)
Get the line number of the given variable.
Scopes
LLVM.DIScope
— TypeDIScope
Abstract supertype for lexical scopes and types (which are also declaration contexts).
LLVM.file
— Methodfile(scope::DIScope)
Get the metadata of the file associated with a given scope.
LLVM.name
— Methodname(scope::DIScope)
Get the name of the given scope.
File
LLVM.DIFile
— TypeDIFile
A file in the source code.
LLVM.directory
— Functiondirectory(file::DIFile)
Get the directory of a given file.
LLVM.filename
— Functionfilename(file::DIFile)
Get the filename of the given file.
LLVM.source
— Functionsource(file::DIFile)
Get the source of the given file, or nothing
if the source is not available.
Type
LLVM.DIType
— TypeDIType
Abstract supertype for all type-like metadata nodes.
LLVM.name
— Methodname(typ::DIType)
Get the name of the given type.
Base.sizeof
— Methodsizeof(typ::DIType)
Get the size in bits of the given type.
LLVM.offset
— Methodoffset(typ::DIType)
Get the offset in bits of the given type.
LLVM.line
— Methodline(typ::DIType)
Get the line number of the given type.
LLVM.flags
— Methodflags(typ::DIType)
Get the flags of the given type.
Subprogram
LLVM.DISubProgram
— TypeDISubProgram
A subprogram in the source code.
LLVM.line
— Methodline(subprogram::DISubProgram)
Get the line number of the given subprogram.
Compile Unit
LLVM.DICompileUnit
— TypeDICompileUnit
A compilation unit in the source code.
Other
LLVM.DEBUG_METADATA_VERSION
— FunctionDEBUG_METADATA_VERSION()
The current debug info version number, as supported by LLVM.
LLVM.strip_debuginfo!
— Functionstrip_debuginfo!(mod::Module)
Strip the debug information from the given module.
LLVM.subprogram
— Methodsubprogram(func::Function) -> DISubProgram
Get the subprogram of the given function, or nothing
if the function has no subprogram.
LLVM.subprogram!
— Functionsubprogram!(func::Function, sp::DISubProgram)
Set the subprogram of the given function.