Select returns (cond ? x : y). x and y must be of the same type.
(cond, x, y *Value)
| 306 | |
| 307 | // Select returns (cond ? x : y). x and y must be of the same type. |
| 308 | func (b *Builder) Select(cond, x, y *Value) *Value { |
| 309 | assertTypesEqual(x.Type(), y.Type()) |
| 310 | assertTypesEqual(cond.Type(), b.m.Types.Bool) |
| 311 | return b.val(x.Type(), b.llvm.CreateSelect(cond.llvm, x.llvm, y.llvm, |
| 312 | fmt.Sprintf("(%v?%v:%v)", cond.Name(), x.Name(), y.Name()))) |
| 313 | } |
| 314 | |
| 315 | // Scalar returns a constant scalar with the value v. |
| 316 | func (b *Builder) Scalar(v interface{}) *Value { |
no test coverage detected