NotEqual returns x != y. The types of the two values must be equal.
(x, y *Value)
| 113 | |
| 114 | // NotEqual returns x != y. The types of the two values must be equal. |
| 115 | func (b *Builder) NotEqual(x, y *Value) *Value { |
| 116 | ty := x.Type() |
| 117 | if ty, ok := ty.(*Struct); ok { |
| 118 | assertTypesEqual(x.Type(), y.Type()) |
| 119 | var neq *Value |
| 120 | for i, f := range ty.Fields() { |
| 121 | x, y := x.Extract(f.Name), y.Extract(f.Name) |
| 122 | if i == 0 { |
| 123 | neq = b.NotEqual(x, y) |
| 124 | } else { |
| 125 | neq = b.Or(neq, b.NotEqual(x, y)) |
| 126 | } |
| 127 | } |
| 128 | return neq |
| 129 | } |
| 130 | return b.cmp(x, "!=", y, llvm.IntNE, llvm.IntNE, llvm.FloatONE) |
| 131 | } |
| 132 | |
| 133 | // GreaterThan returns x > y. The types of the two values must be equal. |
| 134 | func (b *Builder) GreaterThan(x, y *Value) *Value { |
no test coverage detected