MCPcopy Create free account
hub / github.com/google/gapid / pointerRange

Method pointerRange

gapil/compiler/expressions.go:509–522  ·  view source on GitHub ↗
(s *S, e *semantic.PointerRange)

Source from the content-addressed store, hash-verified

507}
508
509func (c *C) pointerRange(s *S, e *semantic.PointerRange) *codegen.Value {
510 elTy := c.T.Capture(e.Type.To)
511 root := c.expression(s, e.Pointer).Cast(c.T.Uint64).SetName("root")
512 start := c.expression(s, e.Range.LHS).Cast(c.T.Uint64).SetName("start")
513 end := c.expression(s, e.Range.RHS).Cast(c.T.Uint64).SetName("end")
514 offset := s.Mul(start, s.SizeOf(elTy)).Cast(c.T.Uint64).SetName("offset")
515 count := s.Sub(end, start).SetName("count")
516 size := s.Mul(count, s.SizeOf(elTy)).Cast(c.T.Uint64).SetName("size")
517 return s.Zero(c.T.Sli).
518 Insert(SliceRoot, root).
519 Insert(SliceBase, s.Add(root, offset)).
520 Insert(SliceSize, size).
521 Insert(SliceCount, count)
522}
523
524func (c *C) select_(s *S, e *semantic.Select) *codegen.Value {
525 val := c.expression(s, e.Value)

Callers 1

expressionMethod · 0.95

Calls 10

expressionMethod · 0.95
SetNameMethod · 0.80
MulMethod · 0.80
CaptureMethod · 0.65
InsertMethod · 0.65
AddMethod · 0.65
CastMethod · 0.45
SizeOfMethod · 0.45
SubMethod · 0.45
ZeroMethod · 0.45

Tested by

no test coverage detected