-/// getBitCastOperand - If the specified operand is a CastInst, a constant
-/// expression bitcast, or a GetElementPtrInst with all zero indices, return the
-/// operand value, otherwise return null.
-
-// FIXME: Value::stripPointerCasts
-static Value *getBitCastOperand(Value *V) {
- if (Operator *O = dyn_cast<Operator>(V)) {
- if (O->getOpcode() == Instruction::BitCast)
- return O->getOperand(0);
- if (GEPOperator *GEP = dyn_cast<GEPOperator>(V))
- if (GEP->hasAllZeroIndices())
- return GEP->getPointerOperand();
- }
- return 0;
-}
-
-