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

Method Zero

core/codegen/arithmetic.go:25–30  ·  view source on GitHub ↗

Zero returns a zero-value of the specified type.

(ty Type)

Source from the content-addressed store, hash-verified

23
24// Zero returns a zero-value of the specified type.
25func (b *Builder) Zero(ty Type) *Value {
26 if ty == b.m.Types.Void {
27 return nil
28 }
29 return b.val(ty, llvm.ConstNull(ty.llvmTy())).SetName("zero")
30}
31
32// One returns a one-value of the specified bool, int or float type.
33func (b *Builder) One(ty Type) *Value {

Callers 1

ForNMethod · 0.95

Calls 3

valMethod · 0.95
SetNameMethod · 0.80
llvmTyMethod · 0.65

Tested by

no test coverage detected