Zero returns a zero-value of the specified type.
(ty Type)
| 23 | |
| 24 | // Zero returns a zero-value of the specified type. |
| 25 | func (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. |
| 33 | func (b *Builder) One(ty Type) *Value { |