hphp/runtime/vm/jit/ir-instruction.cpp
/*
* Analyze the type of return element (key or value) for different container.
*/
Analyze the type of return element (key or value) for different container.
Analyze the type of return element ( key or value ) for different container .
Type vecFirstLastReturn(const IRInstruction* inst, bool first) {
  assertx(inst->is(VecFirst, VecLast));
  assertx(inst->src(0)->type().subtypeOfAny(TVArr, TVec));
  auto elem = vecFirstLastType(inst->src(0)->type(), first, inst->ctx());
  if (!elem.second) {
    elem.first |= TInitNull;
  }
  if (inst->hasTypeParam()) {
    elem.first &= inst->typeParam();
  }
  return elem.first;
}
Type vecFirstLastReturn ( const IRInstruction * inst , bool first ) { assertx ( inst -> is ( VecFirst , VecLast ) ) ; assertx ( inst -> src ( 0 ) -> type ( ) . subtypeOfAny ( TVArr , TVec ) ) ; auto elem = vecFirstLastType ( inst -> src ( 0 ) -> type ( ) , first , inst -> ctx ( ) ) ; if ( ! elem . second ) { elem . first |= TInitNull ; } if ( inst -> hasTypeParam ( ) ) { elem . first &= inst -> typeParam ( ) ; } return elem . first ; }
Analyze the type of return element (key or value) for different container.
Analyze the type of return element ( key or value ) for different container .