Protocols
The following protocols are available globally.
-
An
See moreIRGlobal
is a value, alias, or function that exists at the top level of an LLVM module.Declaration
Swift
public protocol IRGlobal : IRConstant
-
A protocol to which the phantom types for a constant’s representation conform.
Declaration
Swift
public protocol ConstantRepresentation
-
A protocol to which the phantom types for all numerical constants conform.
Declaration
Swift
public protocol NumericalConstantRepresentation : ConstantRepresentation
-
A protocol to which the phantom types for integral constants conform.
Declaration
Swift
public protocol IntegralConstantRepresentation : NumericalConstantRepresentation
-
An LLVM attribute.
Functions, return types and each parameter may have a set of attributes associated with them. Such attributes are used to communicate additional information about a function. Attributes are considered to be part of the function, but not of the function type.
See moreDeclaration
Swift
public protocol Attribute
-
An unfortunate artifact of the design of the metadata class hierarchy is that you may find it convenient to force-cast metadata nodes. In general, this behavior is not encouraged, but it will be supported for now.
See moreDeclaration
Swift
public protocol _IRMetadataInitializerHack
-
The
Metadata
protocol captures those types that represent metadata nodes in LLVM IR.LLVM IR allows metadata to be attached to instructions in the program that can convey extra information about the code to the optimizers and code generator. One example application of metadata is source-level debug information.
Metadata does not have a type, and is not a value. If referenced from a call instruction, it uses the metadata type.
Debug Information
The idea of LLVM debugging information is to capture how the important pieces of the source-language’s Abstract Syntax Tree map onto LLVM code. LLVM takes a number of positions on the impact of the broader compilation process on debug information:
- Debugging information should have very little impact on the rest of the compiler. No transformations, analyses, or code generators should need to be modified because of debugging information.
- LLVM optimizations should interact in well-defined and easily described ways with the debugging information.
- Because LLVM is designed to support arbitrary programming languages, LLVM-to-LLVM tools should not need to know anything about the semantics of the source-level-language.
- Source-level languages are often widely different from one another. LLVM should not put any restrictions of the flavor of the source-language, and the debugging information should work with any language.
- With code generator support, it should be possible to use an LLVM compiler to compile a program to native machine code and standard debugging formats. This allows compatibility with traditional machine-code level debuggers, like GDB, DBX, or CodeView.
Declaration
Swift
public protocol IRMetadata : _IRMetadataInitializerHack
-
Denotes a scope in which child metadata nodes can be inserted.
See moreDeclaration
Swift
public protocol DIScope : IRMetadata
-
An
See moreIRType
is a type that is capable of lowering itself to anLLVMTypeRef
object for use with LLVM’s C API.Declaration
Swift
public protocol IRType
-
An
See moreIRValue
is a type that is capable of lowering itself to anLLVMValueRef
object for use with LLVM’s C API.Declaration
Swift
public protocol IRValue