asmdecl

Imports

Imports #

"bytes"
"fmt"
"go/ast"
"go/build"
"go/token"
"go/types"
"log"
"regexp"
"strconv"
"strings"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"

Constants & Variables

Analyzer var #

var Analyzer = *ast.UnaryExpr

Doc const #

const Doc = "report mismatches between assembly files and Go declarations"

abiSuff var #

var abiSuff = *ast.CallExpr

arches var #

var arches = []*asmArch{...}

asmArch386 var #

var asmArch386 = asmArch{...}

asmArchAmd64 var #

var asmArchAmd64 = asmArch{...}

asmArchArm var #

var asmArchArm = asmArch{...}

asmArchArm64 var #

var asmArchArm64 = asmArch{...}

asmArchLoong64 var #

var asmArchLoong64 = asmArch{...}

asmArchMips var #

var asmArchMips = asmArch{...}

asmArchMips64 var #

var asmArchMips64 = asmArch{...}

asmArchMips64LE var #

var asmArchMips64LE = asmArch{...}

asmArchMipsLE var #

var asmArchMipsLE = asmArch{...}

asmArchPpc64 var #

var asmArchPpc64 = asmArch{...}

asmArchPpc64LE var #

var asmArchPpc64LE = asmArch{...}

asmArchRISCV64 var #

var asmArchRISCV64 = asmArch{...}

asmArchS390X var #

var asmArchS390X = asmArch{...}

asmArchWasm var #

var asmArchWasm = asmArch{...}

asmArray const #

These special kinds are not valid sizes.

const asmArray

asmComplex const #

These special kinds are not valid sizes.

const asmComplex

asmDATA var #

var asmDATA = *ast.CallExpr

asmEmptyInterface const #

These special kinds are not valid sizes.

const asmEmptyInterface

asmInterface const #

These special kinds are not valid sizes.

const asmInterface

asmNamedFP var #

var asmNamedFP = *ast.CallExpr

asmOpcode var #

var asmOpcode = *ast.CallExpr

asmPlusBuild var #

var asmPlusBuild = *ast.CallExpr

asmSP var #

var asmSP = *ast.CallExpr

asmSlice const #

These special kinds are not valid sizes.

const asmSlice

asmString const #

These special kinds are not valid sizes.

const asmString asmKind = *ast.BinaryExpr

asmStruct const #

These special kinds are not valid sizes.

const asmStruct

asmTEXT var #

var asmTEXT = *ast.CallExpr

asmUnnamedFP var #

var asmUnnamedFP = *ast.CallExpr

ppc64Suff var #

var ppc64Suff = *ast.CallExpr

re var #

var re = regexp.MustCompile

Type Aliases

asmKind type #

'kind' is a kind of assembly variable. The kinds 1, 2, 4, 8 stand for values of that size.

type asmKind int

Structs

asmArch struct #

An asmArch describes assembly parameters for an architecture

type asmArch struct {
name string
bigEndian bool
stack string
lr bool
retRegs []string
writeResult []string
sizes types.Sizes
intSize int
ptrSize int
maxAlign int
}

asmFunc struct #

An asmFunc describes the expected variables for a function on a given architecture.

type asmFunc struct {
arch *asmArch
size int
vars map[string]*asmVar
varByOffset map[int]*asmVar
}

asmVar struct #

An asmVar describes a single assembly variable.

type asmVar struct {
name string
kind asmKind
typ string
off int
size int
inner []*asmVar
}

component struct #

A component is an assembly-addressable component of a composite type, or a composite type itself.

type component struct {
size int
offset int
kind asmKind
typ string
suffix string
outer string
}

Functions

appendComponentsRecursive function #

appendComponentsRecursive implements componentsOfType. Recursion is required to correct handle structs and arrays, which can contain arbitrary other types.

func appendComponentsRecursive(arch *asmArch, t types.Type, cc []component, suffix string, off int) []component

asmCheckVar function #

asmCheckVar checks a single variable reference.

func asmCheckVar(badf func(string, ...interface{}), fn *asmFunc, line string, expr string, off int, v *asmVar, archDef *asmArch)

asmKindForType function #

func asmKindForType(t types.Type, size int) asmKind

asmParseDecl function #

asmParseDecl parses a function decl for expected assembly variables.

func asmParseDecl(pass *analysis.Pass, decl *ast.FuncDecl) map[string]*asmFunc

componentsOfType function #

componentsOfType generates a list of components of type t. For example, given string, the components are the string itself, the base, and the length.

func componentsOfType(arch *asmArch, t types.Type) []component

init function #

func init()

newComponent function #

func newComponent(suffix string, kind asmKind, typ string, offset int, size int, outer string) component

run function #

func run(pass *analysis.Pass) (interface{}, error)

Generated with Arrow