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

Method Select

core/codegen/arithmetic.go:308–313  ·  view source on GitHub ↗

Select returns (cond ? x : y). x and y must be of the same type.

(cond, x, y *Value)

Source from the content-addressed store, hash-verified

306
307// Select returns (cond ? x : y). x and y must be of the same type.
308func (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.
316func (b *Builder) Scalar(v interface{}) *Value {

Callers 7

PrintfSpecifierMethod · 0.95
copyMethod · 0.80
encodeValueMethod · 0.80
buildEncodeTypeFuncsMethod · 0.80
valueMethod · 0.80
runMethod · 0.80
isReadyMethod · 0.80

Calls 4

valMethod · 0.95
assertTypesEqualFunction · 0.85
TypeMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected