metadata

package
v0.3.0-pre4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: Unlicense Imports: 6 Imported by: 10

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 DIBasicType

type DIBasicType struct {
	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) String

func (md *DIBasicType) String() string

String returns a string representation of the specialized metadata node.

type DICompileUnit

type DICompileUnit struct {
	Language              enum.DwarfLang     // required.
	File                  Field              // 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                 Field              // optional; nil if not present.
	RetainedTypes         Field              // optional; nil if not present.
	Globals               Field              // optional; nil if not present.
	Imports               Field              // optional; nil if not present.
	Macros                Field              // 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.
}

DICompileUnit is a specialized metadata node.

func (*DICompileUnit) String

func (md *DICompileUnit) String() string

String returns a string representation of the specialized metadata node.

type DICompositeType

type DICompositeType struct {
	Tag            enum.DwarfTag  // required.
	Name           string         // optional; empty if not present.
	Scope          Field          // optional; nil if not present.
	File           Field          // 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       Field          // optional; nil if not present.
	RuntimeLang    enum.DwarfLang // optional; zero value if not present.
	VtableHolder   Field          // optional; nil if not present.
	TemplateParams Field          // optional; nil if not present.
	Identifier     string         // optional; empty if not present.
	Discriminator  Field          // optional; nil if not present.
}

DICompositeType is a specialized metadata node.

func (*DICompositeType) String

func (md *DICompositeType) String() string

String returns a string representation of the specialized metadata node.

type DIDerivedType

type DIDerivedType struct {
	Tag               enum.DwarfTag // required.
	Name              string        // optional; empty if not present.
	Scope             Field         // optional; nil if not present.
	File              Field         // 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.
}

DIDerivedType is a specialized metadata node.

func (*DIDerivedType) String

func (md *DIDerivedType) String() string

String returns a string representation of the specialized metadata node.

type DIEnumerator

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

DIEnumerator is a specialized metadata node.

func (*DIEnumerator) String

func (md *DIEnumerator) String() string

String returns a string representation of the specialized metadata node.

type DIExpression

type DIExpression struct {
	Fields []DIExpressionField
}

DIExpression is a specialized metadata node.

func (*DIExpression) String

func (md *DIExpression) String() string

String returns a string 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()
}

type DIFile

type DIFile struct {
	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) String

func (md *DIFile) String() string

String returns a string representation of the specialized metadata node.

type DIGlobalVariable

type DIGlobalVariable struct {
	Name           string // required.
	Scope          Field  // optional; nil if not present.
	LinkageName    string // optional; empty if not present.
	File           Field  // 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 Field  // optional; nil if not present.
	Declaration    Field  // optional; nil if not present.
	Align          uint64 // optional; zero value if not present.
}

DIGlobalVariable is a specialized metadata node.

func (*DIGlobalVariable) String

func (md *DIGlobalVariable) String() string

String returns a string representation of the specialized metadata node.

type DIGlobalVariableExpression

type DIGlobalVariableExpression struct {
	Var Field // required.

	Expr Field // required.
}

DIGlobalVariableExpression is a specialized metadata node.

func (*DIGlobalVariableExpression) String

func (md *DIGlobalVariableExpression) String() string

String returns a string representation of the specialized metadata node.

type DIImportedEntity

type DIImportedEntity struct {
	Tag    enum.DwarfTag // required.
	Scope  Field         // required.
	Entity Field         // optional; nil if not present.
	File   Field         // optional; nil if not present.
	Line   int64         // optional; zero value if not present.
	Name   string        // optional; empty if not present.
}

DIImportedEntity is a specialized metadata node.

func (*DIImportedEntity) String

func (md *DIImportedEntity) String() string

String returns a string representation of the specialized metadata node.

type DILabel

type DILabel struct {
	Scope Field  // required.
	Name  string // required.
	File  Field  // required.
	Line  int64  // required.
}

DILabel is a specialized metadata node.

func (*DILabel) String

func (md *DILabel) String() string

String returns a string representation of the specialized metadata node.

type DILexicalBlock

type DILexicalBlock struct {
	Scope  Field // required.
	File   Field // 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) String

func (md *DILexicalBlock) String() string

String returns a string representation of the specialized metadata node.

type DILexicalBlockFile

type DILexicalBlockFile struct {
	Scope         Field  // required.
	File          Field  // optional; nil if not present.
	Discriminator uint64 // required.
}

DILexicalBlockFile is a specialized metadata node.

func (*DILexicalBlockFile) String

func (md *DILexicalBlockFile) String() string

String returns a string representation of the specialized metadata node.

type DILocalVariable

type DILocalVariable struct {
	Name  string      // optional; empty if not present.
	Arg   uint64      // optional; zero value if not present.
	Scope Field       // required.
	File  Field       // 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.
}

DILocalVariable is a specialized metadata node.

func (*DILocalVariable) String

func (md *DILocalVariable) String() string

String returns a string representation of the specialized metadata node.

type DILocation

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

DILocation is a specialized metadata node.

func (*DILocation) String

func (md *DILocation) String() string

String returns a string representation of the specialized metadata node.

type DIMacro

type DIMacro struct {
	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) String

func (md *DIMacro) String() string

String returns a string representation of the specialized metadata node.

type DIMacroFile

type DIMacroFile struct {
	Type  enum.DwarfMacinfo // optional; zero value if not present.
	Line  int64             // optional; zero value if not present.
	File  Field             // required.
	Nodes Field             // optional; nil if not present.
}

DIMacroFile is a specialized metadata node.

func (*DIMacroFile) String

func (md *DIMacroFile) String() string

String returns a string representation of the specialized metadata node.

type DIModule

type DIModule struct {
	Scope        Field  // required.
	Name         string // required.
	ConfigMacros string // optional; empty if not present.
	IncludePath  string // optional; empty if not present.
	Isysroot     string // optional; empty if not present.
}

DIModule is a specialized metadata node.

func (*DIModule) String

func (md *DIModule) String() string

String returns a string representation of the specialized metadata node.

type DINamespace

type DINamespace struct {
	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) String

func (md *DINamespace) String() string

String returns a string representation of the specialized metadata node.

type DIObjCProperty

type DIObjCProperty struct {
	Name       string // optional; empty if not present.
	File       Field  // 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) String

func (md *DIObjCProperty) String() string

String returns a string representation of the specialized metadata node.

type DISubprogram

type DISubprogram struct {
	Scope          Field                // optional; nil if not present.
	Name           string               // optional; empty if not present.
	LinkageName    string               // optional; empty if not present.
	File           Field                // 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.
	IsOptimized    bool                 // optional; zero value if not present.
	Unit           Field                // optional; nil if not present.
	TemplateParams Field                // optional; nil if not present.
	Declaration    Field                // optional; nil if not present.
	RetainedNodes  Field                // optional; nil if not present.
	ThrownTypes    Field                // optional; nil if not present.
}

DISubprogram is a specialized metadata node.

func (*DISubprogram) String

func (md *DISubprogram) String() string

String returns a string representation of the specialized metadata node.

type DISubrange

type DISubrange struct {
	Count      FieldOrInt // required.
	LowerBound int64      // optional; zero value if not present.
}

DISubrange is a specialized metadata node.

func (*DISubrange) String

func (md *DISubrange) String() string

String returns a string representation of the specialized metadata node.

type DISubroutineType

type DISubroutineType struct {
	Flags enum.DIFlag  // optional.
	CC    enum.DwarfCC // optional; zero value if not present.
	Types Field        // required.
}

DISubroutineType is a specialized metadata node.

func (*DISubroutineType) String

func (md *DISubroutineType) String() string

String returns a string representation of the specialized metadata node.

type DITemplateTypeParameter

type DITemplateTypeParameter struct {
	Name string // optional; empty if not present.
	Type Field  // required.
}

DITemplateTypeParameter is a specialized metadata node.

func (*DITemplateTypeParameter) String

func (md *DITemplateTypeParameter) String() string

String returns a string representation of the specialized metadata node.

type DITemplateValueParameter

type DITemplateValueParameter struct {
	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.
}

DITemplateValueParameter is a specialized metadata node.

func (*DITemplateValueParameter) String

func (md *DITemplateValueParameter) String() string

String returns a string representation of the specialized metadata node.

type Def

type Def struct {
	// Metadata definition ID (without '!' prefix).
	ID int64
	// Metadata definition node.
	Node MDNode // Tuple or SpecializedNode

	// (optional) Distinct.
	Distinct bool
}

Def is a metadata definition.

func (*Def) Def

func (md *Def) Def() string

Def returns the LLVM syntax representation of the metadata definition.

func (*Def) String

func (md *Def) String() string

String returns the string representation of the metadata definition.

type Field

type Field interface {
	fmt.Stringer
}

type FieldOrInt

type FieldOrInt interface {
	fmt.Stringer
}

type GenericDINode

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

GenericDINode is a specialized GenericDINode metadata node.

func (*GenericDINode) String

func (md *GenericDINode) String() string

String returns a string 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 string representation of the integer literal.

type MDNode

type MDNode interface {
	fmt.Stringer
}

Tuple or SpecializedNode

type Metadata

type Metadata interface {
	fmt.Stringer
}

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) Def

func (md *NamedDef) Def() string

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

func (*NamedDef) String

func (md *NamedDef) String() string

String returns the string representation of the named metadata definition.

type Node

type Node interface {
	fmt.Stringer
}

type NullLit

type NullLit struct{}

NullLit is a metadata null literal.

func (*NullLit) String

func (i *NullLit) String() string

String returns the string representation of the metadata null literal.

type SpecializedNode

type SpecializedNode interface {
	fmt.Stringer
}

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 string representation of the metadata string.

type Tuple

type Tuple struct {
	// Metadata tuple fields.
	Fields []Field
}

Tuple is a metadata node tuple.

func (*Tuple) String

func (md *Tuple) String() string

String returns the string representation of the metadata node 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 string 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