metadata

package
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2022 License: 0BSD, Unlicense Imports: 7 Imported by: 7

Documentation

Overview

Package metadata provides access to LLVM IR metadata.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Null metadata literal.
	Null = &NullLit{}
)

Convenience literals.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	// Metadata attachment name (without '!' prefix); e.g. !dbg.
	Name string
	// Metadata attachment node.
	Node MDNode
}

Attachment is a metadata attachment.

func (*Attachment) String

func (m *Attachment) String() string

String returns the string representation of the metadata attachment.

type DIArgList added in v0.3.5

type DIArgList struct {
	Fields []value.Value
}

DIArgList is a metadata node containing a list of function local values.

func (*DIArgList) LLString added in v0.3.5

func (md *DIArgList) LLString() string

LLString returns the LLVM syntax representation of the DIArgList metadata node.

'!DIArgList' '(' Fields=(DIArgListField separator ',')* ')'

func (*DIArgList) String added in v0.3.5

func (md *DIArgList) String() string

String returns the LLVM syntax representation of the DIArgList metadata node.

type DIBasicType

type DIBasicType struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Tag      enum.DwarfTag         // optional; zero value if not present.
	Name     string                // optional; empty if not present.
	Size     uint64                // optional; zero value if not present.
	Align    uint64                // optional; zero value if not present.
	Encoding enum.DwarfAttEncoding // optional; zero value if not present.
	Flags    enum.DIFlag           // optional.
}

DIBasicType is a specialized metadata node.

func (*DIBasicType) Ident

func (md *DIBasicType) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIBasicType) LLString

func (md *DIBasicType) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIBasicType' '(' Fields=(DIBasicTypeField separator ',')* ')'

func (*DIBasicType) SetDistinct

func (md *DIBasicType) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIBasicType) String

func (md *DIBasicType) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DICommonBlock

type DICommonBlock struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Scope       Field   // required.
	Declaration Field   // optional; nil if not present.
	Name        string  // optional; empty if not present.
	File        *DIFile // required.
	Line        int64   // optional; zero value if not present.
}

DICommonBlock is a specialized metadata node.

func (*DICommonBlock) Ident

func (md *DICommonBlock) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DICommonBlock) LLString

func (md *DICommonBlock) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DICommonBlock' '(' Fields=(DICommonBlockField separator ',')* ')'

func (*DICommonBlock) SetDistinct

func (md *DICommonBlock) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DICommonBlock) String

func (md *DICommonBlock) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DICompileUnit

type DICompileUnit struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Language              enum.DwarfLang     // required.
	File                  *DIFile            // required.
	Producer              string             // optional; empty if not present.
	IsOptimized           bool               // optional; zero value if not present.
	Flags                 string             // optional; empty if not present.
	RuntimeVersion        uint64             // optional; zero value if not present.
	SplitDebugFilename    string             // optional; empty if not present.
	EmissionKind          enum.EmissionKind  // optional; zero value if not present.
	Enums                 *Tuple             // optional; nil if not present.
	RetainedTypes         *Tuple             // optional; nil if not present.
	Globals               *Tuple             // optional; nil if not present.
	Imports               *Tuple             // optional; nil if not present.
	Macros                *Tuple             // optional; nil if not present.
	DwoID                 uint64             // optional; zero value if not present.
	SplitDebugInlining    bool               // optional; zero value if not present.
	DebugInfoForProfiling bool               // optional; zero value if not present.
	NameTableKind         enum.NameTableKind // optional; zero value if not present.
	RangesBaseAddress     bool               // optional; zero value if not present.
	Sysroot               string             // optional; zero value if not present.
	SDK                   string             // optional; zero value if not present.
}

DICompileUnit is a specialized metadata node.

func (*DICompileUnit) Ident

func (md *DICompileUnit) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DICompileUnit) LLString

func (md *DICompileUnit) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DICompileUnit' '(' Fields=(DICompileUnitField separator ',')* ')'

func (*DICompileUnit) SetDistinct

func (md *DICompileUnit) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DICompileUnit) String

func (md *DICompileUnit) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DICompositeType

type DICompositeType struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Tag         enum.DwarfTag  // required.
	Name        string         // optional; empty if not present.
	Scope       Field          // optional; nil if not present.
	File        *DIFile        // optional; nil if not present.
	Line        int64          // optional; zero value if not present.
	BaseType    Field          // optional; nil if not present.
	Size        uint64         // optional; zero value if not present.
	Align       uint64         // optional; zero value if not present.
	Offset      uint64         // optional; zero value if not present.
	Flags       enum.DIFlag    // optional.
	Elements    *Tuple         // optional; nil if not present.
	RuntimeLang enum.DwarfLang // optional; zero value if not present.
	// *DIBasicType or *DICompositeType
	VtableHolder   Field      // optional; nil if not present.
	TemplateParams *Tuple     // optional; nil if not present.
	Identifier     string     // optional; empty if not present.
	Discriminator  Field      // optional; nil if not present.
	DataLocation   Field      // optional; nil if not present.
	Associated     Field      // optional; nil if not present.
	Allocated      Field      // optional; nil if not present.
	Rank           FieldOrInt // optional; nil if not present.
	Annotations    Field      // optional; nil if not present.
}

DICompositeType is a specialized metadata node.

func (*DICompositeType) Ident

func (md *DICompositeType) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DICompositeType) LLString

func (md *DICompositeType) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DICompositeType' '(' Fields=(DICompositeTypeField separator ',')* ')'

func (*DICompositeType) SetDistinct

func (md *DICompositeType) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DICompositeType) String

func (md *DICompositeType) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIDerivedType

type DIDerivedType struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Tag               enum.DwarfTag // required.
	Name              string        // optional; empty if not present.
	Scope             Field         // optional; nil if not present.
	File              *DIFile       // optional; nil if not present.
	Line              int64         // optional; zero value if not present.
	BaseType          Field         // required.
	Size              uint64        // optional; zero value if not present.
	Align             uint64        // optional; zero value if not present.
	Offset            uint64        // optional; zero value if not present.
	Flags             enum.DIFlag   // optional.
	ExtraData         Field         // optional; nil if not present.
	DwarfAddressSpace uint64        // optional; zero value if not present.
	Annotations       Field         // optional; nil if not present.
}

DIDerivedType is a specialized metadata node.

func (*DIDerivedType) Ident

func (md *DIDerivedType) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIDerivedType) LLString

func (md *DIDerivedType) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIDerivedType' '(' Fields=(DIDerivedTypeField separator ',')* ')'

func (*DIDerivedType) SetDistinct

func (md *DIDerivedType) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIDerivedType) String

func (md *DIDerivedType) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIEnumerator

type DIEnumerator struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Name       string // required.
	Value      int64  // required.
	IsUnsigned bool   // optional; zero value if not present.
}

DIEnumerator is a specialized metadata node.

func (*DIEnumerator) Ident

func (md *DIEnumerator) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIEnumerator) LLString

func (md *DIEnumerator) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIEnumerator' '(' Fields=(DIEnumeratorField separator ',')* ')'

func (*DIEnumerator) SetDistinct

func (md *DIEnumerator) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIEnumerator) String

func (md *DIEnumerator) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIExpression

type DIExpression struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Fields []DIExpressionField
}

DIExpression is a specialized metadata node.

func (*DIExpression) Ident

func (md *DIExpression) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIExpression) LLString

func (md *DIExpression) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIExpression' '(' Fields=(DIExpressionField separator ',')* ')'

func (*DIExpression) SetDistinct

func (md *DIExpression) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIExpression) String

func (md *DIExpression) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIExpressionField

type DIExpressionField interface {
	fmt.Stringer
	// IsDIExpressionField ensures that only DIExpression fields can be assigned
	// to the metadata.DIExpressionField interface.
	IsDIExpressionField()
}

DIExpressionField is a metadata DIExpression field.

A DIExpressionField has one of the following underlying types.

metadata.UintLit        // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#UintLit
enum.DwarfAttEncoding   // https://pkg.go.dev/github.com/llir/llvm/ir/enum#DwarfAttEncoding
enum.DwarfOp            // https://pkg.go.dev/github.com/llir/llvm/ir/enum#DwarfOp

type DIFile

type DIFile struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Filename     string            // required.
	Directory    string            // required.
	Checksumkind enum.ChecksumKind // optional; zero value if not present.
	Checksum     string            // optional; empty if not present.
	Source       string            // optional; empty if not present.
}

DIFile is a specialized metadata node.

func (*DIFile) Ident

func (md *DIFile) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIFile) LLString

func (md *DIFile) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIFile' '(' Fields=(DIFileField separator ',')* ')'

func (*DIFile) SetDistinct

func (md *DIFile) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIFile) String

func (md *DIFile) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIGlobalVariable

type DIGlobalVariable struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Name           string  // required.
	Scope          Field   // optional; nil if not present.
	LinkageName    string  // optional; empty if not present.
	File           *DIFile // optional; nil if not present.
	Line           int64   // optional; zero value if not present.
	Type           Field   // optional; nil if not present.
	IsLocal        bool    // optional; zero value if not present.
	IsDefinition   bool    // optional; zero value if not present.
	TemplateParams *Tuple  // optional; nil if not present.
	Declaration    Field   // optional; nil if not present.
	Align          uint64  // optional; zero value if not present.
	Annotations    Field   // optional; nil if not present.
}

DIGlobalVariable is a specialized metadata node.

func (*DIGlobalVariable) Ident

func (md *DIGlobalVariable) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIGlobalVariable) LLString

func (md *DIGlobalVariable) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIGlobalVariable' '(' Fields=(DIGlobalVariableField separator ',')* ')'

func (*DIGlobalVariable) SetDistinct

func (md *DIGlobalVariable) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIGlobalVariable) String

func (md *DIGlobalVariable) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIGlobalVariableExpression

type DIGlobalVariableExpression struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Var  *DIGlobalVariable // required.
	Expr *DIExpression     // required.
}

DIGlobalVariableExpression is a specialized metadata node.

func (*DIGlobalVariableExpression) Ident

func (md *DIGlobalVariableExpression) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIGlobalVariableExpression) LLString

func (md *DIGlobalVariableExpression) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIGlobalVariableExpression' '(' Fields=(DIGlobalVariableExpressionField separator ',')* ')'

func (*DIGlobalVariableExpression) SetDistinct

func (md *DIGlobalVariableExpression) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIGlobalVariableExpression) String

func (md *DIGlobalVariableExpression) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIImportedEntity

type DIImportedEntity struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Tag      enum.DwarfTag // required.
	Scope    Field         // required.
	Entity   Field         // optional; nil if not present.
	File     *DIFile       // optional; nil if not present.
	Line     int64         // optional; zero value if not present.
	Name     string        // optional; empty if not present.
	Elements *Tuple        // optional; nil if not present.
}

DIImportedEntity is a specialized metadata node.

func (*DIImportedEntity) Ident

func (md *DIImportedEntity) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIImportedEntity) LLString

func (md *DIImportedEntity) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIImportedEntity' '(' Fields=(DIImportedEntityField separator ',')* ')'

func (*DIImportedEntity) SetDistinct

func (md *DIImportedEntity) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIImportedEntity) String

func (md *DIImportedEntity) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DILabel

type DILabel struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Scope Field   // required.
	Name  string  // required.
	File  *DIFile // required.
	Line  int64   // required.
}

DILabel is a specialized metadata node.

func (*DILabel) Ident

func (md *DILabel) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DILabel) LLString

func (md *DILabel) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DILabel' '(' Fields=(DILabelField separator ',')* ')'

func (*DILabel) SetDistinct

func (md *DILabel) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DILabel) String

func (md *DILabel) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DILexicalBlock

type DILexicalBlock struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Scope  Field   // required.
	File   *DIFile // optional; nil if not present.
	Line   int64   // optional; zero value if not present.
	Column int64   // optional; zero value if not present.
}

DILexicalBlock is a specialized metadata node.

func (*DILexicalBlock) Ident

func (md *DILexicalBlock) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DILexicalBlock) LLString

func (md *DILexicalBlock) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DILexicalBlock' '(' Fields=(DILexicalBlockField separator ',')* ')'

func (*DILexicalBlock) SetDistinct

func (md *DILexicalBlock) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DILexicalBlock) String

func (md *DILexicalBlock) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DILexicalBlockFile

type DILexicalBlockFile struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Scope         Field   // required.
	File          *DIFile // optional; nil if not present.
	Discriminator uint64  // required.
}

DILexicalBlockFile is a specialized metadata node.

func (*DILexicalBlockFile) Ident

func (md *DILexicalBlockFile) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DILexicalBlockFile) LLString

func (md *DILexicalBlockFile) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DILexicalBlockFile' '(' Fields=(DILexicalBlockFileField separator ',')* ')'

func (*DILexicalBlockFile) SetDistinct

func (md *DILexicalBlockFile) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DILexicalBlockFile) String

func (md *DILexicalBlockFile) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DILocalVariable

type DILocalVariable struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Scope       Field       // required.
	Name        string      // optional; empty if not present.
	Arg         uint64      // optional; zero value if not present.
	File        *DIFile     // optional; nil if not present.
	Line        int64       // optional; zero value if not present.
	Type        Field       // optional; nil if not present.
	Flags       enum.DIFlag // optional.
	Align       uint64      // optional; zero value if not present.
	Annotations Field       // optional; nil if not present.
}

DILocalVariable is a specialized metadata node.

func (*DILocalVariable) Ident

func (md *DILocalVariable) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DILocalVariable) LLString

func (md *DILocalVariable) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DILocalVariable' '(' Fields=(DILocalVariableField separator ',')* ')'

func (*DILocalVariable) SetDistinct

func (md *DILocalVariable) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DILocalVariable) String

func (md *DILocalVariable) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DILocation

type DILocation struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Line           int64       // optional; zero value if not present.
	Column         int64       // optional; zero value if not present.
	Scope          Field       // required.
	InlinedAt      *DILocation // optional; nil if not present.
	IsImplicitCode bool        // optional; zero value if not present.
}

DILocation is a specialized metadata node.

func (*DILocation) Ident

func (md *DILocation) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DILocation) LLString

func (md *DILocation) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DILocation' '(' Fields=(DILocationField separator ',')* ')'

func (*DILocation) SetDistinct

func (md *DILocation) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DILocation) String

func (md *DILocation) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIMacro

type DIMacro struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Type  enum.DwarfMacinfo // required.
	Line  int64             // optional; zero value if not present.
	Name  string            // required.
	Value string            // optional; empty if not present.
}

DIMacro is a specialized metadata node.

func (*DIMacro) Ident

func (md *DIMacro) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIMacro) LLString

func (md *DIMacro) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIMacro' '(' Fields=(DIMacroField separator ',')* ')'

func (*DIMacro) SetDistinct

func (md *DIMacro) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIMacro) String

func (md *DIMacro) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIMacroFile

type DIMacroFile struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Type  enum.DwarfMacinfo // optional; zero value if not present.
	Line  int64             // optional; zero value if not present.
	File  *DIFile           // required.
	Nodes *Tuple            // optional; nil if not present.
}

DIMacroFile is a specialized metadata node.

func (*DIMacroFile) Ident

func (md *DIMacroFile) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIMacroFile) LLString

func (md *DIMacroFile) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIMacroFile' '(' Fields=(DIMacroFileField separator ',')* ')'

func (*DIMacroFile) SetDistinct

func (md *DIMacroFile) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIMacroFile) String

func (md *DIMacroFile) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIModule

type DIModule struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Scope        Field  // required.
	Name         string // required.
	ConfigMacros string // optional; empty if not present.
	IncludePath  string // optional; empty if not present.
	APINotes     string // optional; empty if not present.
	File         Field  // optional; empty if not present.
	Line         int64  // optional; zero value if not present.
	IsDecl       bool   // optional; zero value if not present.
}

DIModule is a specialized metadata node.

func (*DIModule) Ident

func (md *DIModule) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIModule) LLString

func (md *DIModule) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIModule' '(' Fields=(DIModuleField separator ',')* ')'

func (*DIModule) SetDistinct

func (md *DIModule) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIModule) String

func (md *DIModule) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DINamespace

type DINamespace struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Scope         Field  // required.
	Name          string // optional; empty if not present.
	ExportSymbols bool   // optional; zero value if not present.
}

DINamespace is a specialized metadata node.

func (*DINamespace) Ident

func (md *DINamespace) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DINamespace) LLString

func (md *DINamespace) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DINamespace' '(' Fields=(DINamespaceField separator ',')* ')'

func (*DINamespace) SetDistinct

func (md *DINamespace) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DINamespace) String

func (md *DINamespace) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIObjCProperty

type DIObjCProperty struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Name       string  // optional; empty if not present.
	File       *DIFile // optional; nil if not present.
	Line       int64   // optional; zero value if not present.
	Setter     string  // optional; empty if not present.
	Getter     string  // optional; empty if not present.
	Attributes uint64  // optional; zero value if not present.
	Type       Field   // optional; nil if not present.
}

DIObjCProperty is a specialized metadata node.

func (*DIObjCProperty) Ident

func (md *DIObjCProperty) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIObjCProperty) LLString

func (md *DIObjCProperty) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIObjCProperty' '(' Fields=(DIObjCPropertyField separator ',')* ')'

func (*DIObjCProperty) SetDistinct

func (md *DIObjCProperty) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIObjCProperty) String

func (md *DIObjCProperty) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DIStringType added in v0.3.6

type DIStringType struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Tag                      enum.DwarfTag         // optional; zero value if not present.
	Name                     string                // optional; empty if not present.
	StringLength             Field                 // optional; nil if not present.
	StringLengthExpression   Field                 // optional; nil if not present.
	StringLocationExpression Field                 // optional; nil if not present.
	Size                     uint64                // optional; zero value if not present.
	Align                    uint64                // optional; zero value if not present.
	Encoding                 enum.DwarfAttEncoding // optional; zero value if not present.
}

DIStringType is a specialized metadata node.

func (*DIStringType) Ident added in v0.3.6

func (md *DIStringType) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DIStringType) LLString added in v0.3.6

func (md *DIStringType) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DIStringType' '(' Fields=(DIStringTypeField separator ',')* ')'

func (*DIStringType) SetDistinct added in v0.3.6

func (md *DIStringType) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DIStringType) String added in v0.3.6

func (md *DIStringType) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DISubprogram

type DISubprogram struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Scope          Field                // optional; nil if not present.
	Name           string               // optional; empty if not present.
	LinkageName    string               // optional; empty if not present.
	File           *DIFile              // optional; nil if not present.
	Line           int64                // optional; zero value if not present.
	Type           Field                // optional; nil if not present.
	IsLocal        bool                 // optional; zero value if not present.
	IsDefinition   bool                 // optional; zero value if not present.
	ScopeLine      int64                // optional; zero value if not present.
	ContainingType Field                // optional; nil if not present.
	Virtuality     enum.DwarfVirtuality // optional; zero value if not present.
	VirtualIndex   uint64               // optional; zero value if not present.
	ThisAdjustment int64                // optional; zero value if not present.
	Flags          enum.DIFlag          // optional.
	SPFlags        enum.DISPFlag        // optional.
	IsOptimized    bool                 // optional; zero value if not present.
	Unit           *DICompileUnit       // optional; nil if not present.
	TemplateParams *Tuple               // optional; nil if not present.
	Declaration    Field                // optional; nil if not present.
	RetainedNodes  *Tuple               // optional; nil if not present.
	ThrownTypes    *Tuple               // optional; nil if not present.
	Annotations    Field                // optional; nil if not present.
}

DISubprogram is a specialized metadata node.

func (*DISubprogram) Ident

func (md *DISubprogram) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DISubprogram) LLString

func (md *DISubprogram) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DISubprogram' '(' Fields=(DISubprogramField separator ',')* ')'

func (*DISubprogram) SetDistinct

func (md *DISubprogram) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DISubprogram) String

func (md *DISubprogram) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DISubrange

type DISubrange struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Count      FieldOrInt // optional
	LowerBound FieldOrInt // optional
	UpperBound FieldOrInt // optional
	Stride     FieldOrInt // optional
}

DISubrange is a specialized metadata node.

func (*DISubrange) Ident

func (md *DISubrange) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DISubrange) LLString

func (md *DISubrange) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DISubrange' '(' Fields=(DISubrangeField separator ',')* ')'

func (*DISubrange) SetDistinct

func (md *DISubrange) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DISubrange) String

func (md *DISubrange) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DISubroutineType

type DISubroutineType struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Flags enum.DIFlag  // optional.
	CC    enum.DwarfCC // optional; zero value if not present.
	Types *Tuple       // required.
}

DISubroutineType is a specialized metadata node.

func (*DISubroutineType) Ident

func (md *DISubroutineType) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DISubroutineType) LLString

func (md *DISubroutineType) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DISubroutineType' '(' Fields=(DISubroutineTypeField separator ',')* ')'

func (*DISubroutineType) SetDistinct

func (md *DISubroutineType) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DISubroutineType) String

func (md *DISubroutineType) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DITemplateTypeParameter

type DITemplateTypeParameter struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Name      string // optional; empty if not present.
	Type      Field  // required.
	Defaulted bool   // optional; zero value if not present.
}

DITemplateTypeParameter is a specialized metadata node.

func (*DITemplateTypeParameter) Ident

func (md *DITemplateTypeParameter) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DITemplateTypeParameter) LLString

func (md *DITemplateTypeParameter) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DITemplateTypeParameter' '(' Fields=(DITemplateTypeParameterField separator ',')* ')'

func (*DITemplateTypeParameter) SetDistinct

func (md *DITemplateTypeParameter) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DITemplateTypeParameter) String

func (md *DITemplateTypeParameter) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type DITemplateValueParameter

type DITemplateValueParameter struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Tag       enum.DwarfTag // optional; zero value if not present.
	Name      string        // optional; empty if not present.
	Type      Field         // optional; nil if not present.
	Value     Field         // required.
	Defaulted bool          // optional; zero value if not present.
}

DITemplateValueParameter is a specialized metadata node.

func (*DITemplateValueParameter) Ident

func (md *DITemplateValueParameter) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*DITemplateValueParameter) LLString

func (md *DITemplateValueParameter) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!DITemplateValueParameter' '(' Fields=(DITemplateValueParameterField separator ',')* ')'

func (*DITemplateValueParameter) SetDistinct

func (md *DITemplateValueParameter) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*DITemplateValueParameter) String

func (md *DITemplateValueParameter) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type Definition

type Definition interface {
	// String returns the LLVM syntax representation of the metadata.
	fmt.Stringer
	// Ident returns the identifier associated with the metadata definition.
	Ident() string
	// ID returns the ID of the metadata definition.
	ID() int64
	// SetID sets the ID of the metadata definition.
	SetID(id int64)
	// LLString returns the LLVM syntax representation of the metadata
	// definition.
	LLString() string
	// SetDistinct specifies whether the metadata definition is dinstict.
	SetDistinct(distinct bool)
}

Definition is a metadata definition.

A Definition has one of the following underlying types.

metadata.MDNode   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#MDNode

type Field

type Field interface {
	// String returns the LLVM syntax representation of the metadata field.
	fmt.Stringer
}

Field is a metadata field.

A Field has one of the following underlying types.

*metadata.NullLit   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#NullLit
metadata.Metadata   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#Metadata

type FieldOrInt

type FieldOrInt interface {
	Field
}

FieldOrInt is a metadata field or integer.

A FieldOrInt has one of the following underlying types.

metadata.Field    // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#Field
metadata.IntLit   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#IntLit

type GenericDINode

type GenericDINode struct {
	// Metadata ID associated with the specialized metadata node; -1 if not
	// present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	Tag      enum.DwarfTag // required
	Header   string        // optional; empty if not present
	Operands []Field       // optional
}

GenericDINode is a specialized GenericDINode metadata node.

func (*GenericDINode) Ident

func (md *GenericDINode) Ident() string

Ident returns the identifier associated with the specialized metadata node.

func (*GenericDINode) LLString

func (md *GenericDINode) LLString() string

LLString returns the LLVM syntax representation of the specialized metadata node.

'!GenericDINode' '(' Fields=(GenericDINodeField separator ',')* ')'

func (*GenericDINode) SetDistinct

func (md *GenericDINode) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*GenericDINode) String

func (md *GenericDINode) String() string

String returns the LLVM syntax representation of the specialized metadata node.

type IntLit

type IntLit int64

IntLit is an integer literal.

func (IntLit) String

func (i IntLit) String() string

String returns the LLVM syntax representation of the integer literal.

type MDNode

type MDNode interface {
	// Ident returns the identifier associated with the metadata node.
	Ident() string
	// LLString returns the LLVM syntax representation of the metadata node.
	LLString() string
}

MDNode is a metadata node.

A MDNode has one of the following underlying types.

*metadata.Tuple            // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#Tuple
metadata.Definition        // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#Definition
metadata.SpecializedNode   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#SpecializedNode

type Metadata

type Metadata interface {
	// String returns the LLVM syntax representation of the metadata.
	fmt.Stringer
}

Metadata is a sumtype of metadata.

A Metadata has one of the following underlying types.

value.Value                // https://pkg.go.dev/github.com/llir/llvm/ir/value#Value
*metadata.String           // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#String
*metadata.Tuple            // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#Tuple
metadata.Definition        // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#Definition
metadata.SpecializedNode   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#SpecializedNode
*metadata.DIArgList        // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIArgList

type MetadataID

type MetadataID int64

MetadataID is a metadata ID, as used by metadata definitions.

func (MetadataID) ID

func (i MetadataID) ID() int64

ID returns the ID of the metadata ID.

func (MetadataID) Ident

func (i MetadataID) Ident() string

Ident returns the identifier associated with the metadata ID.

func (*MetadataID) SetID

func (i *MetadataID) SetID(id int64)

SetID sets the ID of the metadata ID.

type NamedDef

type NamedDef struct {
	// Metadata definition name (without '!' prefix).
	Name string
	// Metadata definition nodes.
	Nodes []Node
}

NamedDef is a named metadata definition.

func (*NamedDef) Ident

func (md *NamedDef) Ident() string

Ident returns the identifier associated with the named metadata definition.

func (*NamedDef) LLString

func (md *NamedDef) LLString() string

LLString returns the LLVM syntax representation of the named metadata definition.

Name=MetadataName '=' '!' '{' MDNodes=(MetadataNode separator ',')* '}'

type Node

type Node interface {
	// Ident returns the identifier associated with the metadata node.
	Ident() string
}

Node is a metadata node.

A Node has one of the following underlying types.

metadata.Definition      // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#Definition
*metadata.DIExpression   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIExpression

type NullLit

type NullLit struct{}

NullLit is a metadata null literal.

func (*NullLit) String

func (i *NullLit) String() string

String returns the LLVM syntax representation of the null literal.

type SpecializedNode

type SpecializedNode interface {
	Definition
}

SpecializedNode is a specialized metadata node.

A SpecializedNode has one of the following underlying types.

*metadata.DIBasicType                  // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIBasicType
*metadata.DICommonBlock                // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DICommonBlock
*metadata.DICompileUnit                // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DICompileUnit
*metadata.DICompositeType              // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DICompositeType
*metadata.DIDerivedType                // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIDerivedType
*metadata.DIEnumerator                 // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIEnumerator
*metadata.DIExpression                 // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIExpression
*metadata.DIFile                       // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIFile
*metadata.DIGlobalVariable             // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIGlobalVariable
*metadata.DIGlobalVariableExpression   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIGlobalVariableExpression
*metadata.DIImportedEntity             // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIImportedEntity
*metadata.DILabel                      // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DILabel
*metadata.DILexicalBlock               // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DILexicalBlock
*metadata.DILexicalBlockFile           // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DILexicalBlockFile
*metadata.DILocalVariable              // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DILocalVariable
*metadata.DILocation                   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DILocation
*metadata.DIMacro                      // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIMacro
*metadata.DIMacroFile                  // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIMacroFile
*metadata.DIModule                     // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIModule
*metadata.DINamespace                  // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DINamespace
*metadata.DIObjCProperty               // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DIObjCProperty
*metadata.DISubprogram                 // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DISubprogram
*metadata.DISubrange                   // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DISubrange
*metadata.DISubroutineType             // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DISubroutineType
*metadata.DITemplateTypeParameter      // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DITemplateTypeParameter
*metadata.DITemplateValueParameter     // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#DITemplateValueParameter
*metadata.GenericDINode                // https://pkg.go.dev/github.com/llir/llvm/ir/metadata#GenericDINode

type String

type String struct {
	// Metadata string value.
	Value string
}

String is a metadata string.

func (*String) String

func (md *String) String() string

String returns the LLVM syntax representation of the metadata string.

type Tuple

type Tuple struct {
	// Metadata ID associated with the metadata tuple; -1 if not present.
	MetadataID
	// (optional) Distinct.
	Distinct bool

	// Metadata tuple fields.
	Fields []Field
}

Tuple is a metadata node tuple.

func (*Tuple) Ident

func (md *Tuple) Ident() string

Ident returns the identifier associated with the metadata tuple.

func (*Tuple) LLString

func (md *Tuple) LLString() string

LLString returns the LLVM syntax representation of the metadata tuple.

'!' MDFields

func (*Tuple) SetDistinct

func (md *Tuple) SetDistinct(distinct bool)

SetDistinct specifies whether the metadata definition is dinstict.

func (*Tuple) String

func (md *Tuple) String() string

String returns the LLVM syntax representation of the metadata tuple.

type UintLit

type UintLit uint64

UintLit is an unsigned integer literal.

func (UintLit) IsDIExpressionField

func (UintLit) IsDIExpressionField()

IsDIExpressionField ensures that only DIExpression fields can be assigned to the metadata.DIExpressionField interface.

func (UintLit) String

func (i UintLit) String() string

String returns the LLVM syntax representation of the unsigned integer literal.

type Value

type Value struct {
	// Metadata value.
	Value Metadata
}

A Value is a metadata value.

func (*Value) Ident

func (md *Value) Ident() string

Ident returns the identifier associated with the metadata value.

func (*Value) String

func (md *Value) String() string

String returns the LLVM syntax representation of the metadata value as a type-value pair.

func (*Value) Type

func (md *Value) Type() types.Type

Type returns the type of the metadata value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL