Protocols

The following protocols are available globally.

  • An IRGlobal is a value, alias, or function that exists at the top level of an LLVM module.

    See more

    Declaration

    Swift

    public protocol IRGlobal : IRConstant
  • An IRInstruction is a value that directly represents an instruction and in particular the result of the execution of that instruction.

    See more

    Declaration

    Swift

    public protocol IRInstruction : IRValue
  • An IRConstant is an entity whose value doees not change during the runtime of a program. This includes global variables and functions, whose addresses are constant, and constant expressions.

    See more

    Declaration

    Swift

    public protocol IRConstant : IRValue
  • 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 more

    Declaration

    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 more

    Declaration

    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.
    See more

    Declaration

    Swift

    public protocol IRMetadata : _IRMetadataInitializerHack
  • Denotes a scope in which child metadata nodes can be inserted.

    See more

    Declaration

    Swift

    public protocol DIScope : IRMetadata
  • Denotes metadata for a type.

    See more

    Declaration

    Swift

    public protocol DIType : DIScope
  • An IRType is a type that is capable of lowering itself to an LLVMTypeRef object for use with LLVM’s C API.

    See more

    Declaration

    Swift

    public protocol IRType
  • An IRValue is a type that is capable of lowering itself to an LLVMValueRef object for use with LLVM’s C API.

    See more

    Declaration

    Swift

    public protocol IRValue