• Home
  • Raw
  • Download

Lines Matching refs:comp

16 func (comp *compiler) genResources() []*prog.ResourceDesc {
18 for name, n := range comp.resources {
19 if !comp.used[name] {
22 resources = append(resources, comp.genResource(n))
30 func (comp *compiler) genResource(n *ast.Resource) *prog.ResourceDesc {
39 n = comp.resources[n.Base.Ident]
44 res.Type = comp.genType(base, "", prog.DirIn, false)
48 func (comp *compiler) genSyscalls() []*prog.Syscall {
50 for _, decl := range comp.desc.Nodes {
52 calls = append(calls, comp.genSyscall(n))
61 func (comp *compiler) genSyscall(n *ast.Call) *prog.Syscall {
64 ret = comp.genType(n.Ret, "ret", prog.DirOut, true)
70 Args: comp.genFieldArray(n.Args, prog.DirIn, true),
75 func (comp *compiler) genStructDescs(syscalls []*prog.Syscall) []*prog.KeyedStruct {
82 comp: comp,
119 comp *compiler member
141 if ctx.comp.used[key.Name] {
184 comp := ctx.comp
185 structNode := comp.structNodes[t.StructDesc]
193 comp.markBitfields(t.Fields)
194 packed, sizeAttr, alignAttr := comp.parseStructAttrs(structNode)
195 t.Fields = comp.addAlignment(t.Fields, varlen, packed, alignAttr)
206 comp.error(structNode.Pos, "struct %v has size attribute %v"+
222 comp := ctx.comp
223 structNode := comp.structNodes[t.StructDesc]
224 varlen, sizeAttr := comp.parseUnionAttrs(structNode)
230 comp.error(structNode.Pos, "union %v has size attribute %v"+
244 func (comp *compiler) genStructDesc(res *prog.StructDesc, n *ast.Struct, dir prog.Dir, varlen bool)…
246 comp.structNodes[res] = n
251 Fields: comp.genFieldArray(n.Fields, dir, false),
255 func (comp *compiler) markBitfields(fields []prog.Type) {
290 func (comp *compiler) addAlignment(fields []prog.Type, varlen, packed bool, alignAttr uint64) []pro…
312 a := comp.typeAlign(f)
342 func (comp *compiler) typeAlign(t0 prog.Type) uint64 {
353 return comp.typeAlign(t.Type)
355 packed, _, alignAttr := comp.parseStructAttrs(comp.structNodes[t.StructDesc])
364 if a := comp.typeAlign(f); align < a {
372 if a := comp.typeAlign(f); align < a {
389 func (comp *compiler) genField(f *ast.Field, dir prog.Dir, isArg bool) prog.Type {
390 return comp.genType(f.Type, f.Name.Name, dir, isArg)
393 func (comp *compiler) genFieldArray(fields []*ast.Field, dir prog.Dir, isArg bool) []prog.Type {
396 res = append(res, comp.genField(f, dir, isArg))
401 func (comp *compiler) genType(t *ast.Type, field string, dir prog.Dir, isArg bool) prog.Type {
402 desc, args, base := comp.getArgsBase(t, field, dir, isArg)
406 base.IsVarlen = desc.Varlen != nil && desc.Varlen(comp, t, args)
407 return desc.Gen(comp, t, args, base)