Home | History | Annotate | Download | only in CBackend

Lines Matching defs:CPV

213     void printConstant(Constant *CPV, bool Static);
214 void printConstantWithCast(Constant *CPV, unsigned Opcode);
751 void CWriter::printConstant(Constant *CPV, bool Static) {
752 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CPV)) {
769 CE->getOperand(0)->getType() == Type::getInt1Ty(CPV->getContext())) {
774 if (CE->getType() == Type::getInt1Ty(CPV->getContext()) &&
787 printGEPExpression(CE->getOperand(0), gep_type_begin(CPV),
788 gep_type_end(CPV), Static);
909 } else if (isa<UndefValue>(CPV) && CPV->getType()->isSingleValueType()) {
911 printType(Out, CPV->getType()); // sign doesn't matter
913 if (!CPV->getType()->isVectorTy()) {
921 if (ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) {
923 if (Ty == Type::getInt1Ty(CPV->getContext()))
925 else if (Ty == Type::getInt32Ty(CPV->getContext()))
941 switch (CPV->getType()->getTypeID()) {
947 ConstantFP *FPC = cast<ConstantFP>(CPV);
952 Out << "(*(" << (FPC->getType() == Type::getFloatTy(CPV->getContext()) ?
954 FPC->getType() == Type::getDoubleTy(CPV->getContext()) ?
960 if (FPC->getType() == Type::getFloatTy(CPV->getContext()))
962 else if (FPC->getType() == Type::getDoubleTy(CPV->getContext()))
1024 printType(Out, CPV->getType());
1028 if (ConstantArray *CA = dyn_cast<ConstantArray>(CPV)) {
1031 assert(isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV));
1032 ArrayType *AT = cast<ArrayType>(CPV->getType());
1052 printType(Out, CPV->getType());
1055 if (ConstantVector *CV = dyn_cast<ConstantVector>(CPV)) {
1058 assert(isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV));
1059 VectorType *VT = cast<VectorType>(CPV->getType());
1075 printType(Out, CPV->getType());
1078 if (isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV)) {
1079 StructType *ST = cast<StructType>(CPV->getType());
1092 if (CPV->getNumOperands()) {
1094 printConstant(cast<Constant>(CPV->getOperand(0)), Static);
1095 for (unsigned i = 1, e = CPV->getNumOperands(); i != e; ++i) {
1097 printConstant(cast<Constant>(CPV->getOperand(i)), Static);
1105 if (isa<ConstantPointerNull>(CPV)) {
1107 printType(Out, CPV->getType()); // sign doesn't matter
1110 } else if (GlobalValue *GV = dyn_cast<GlobalValue>(CPV)) {
1117 errs() << "Unknown constant type: " << *CPV << "\n";
1177 void CWriter::printConstantWithCast(Constant* CPV, unsigned Opcode) {
1180 Type* OpTy = CPV->getType();
1218 printConstant(CPV, false);
1221 printConstant(CPV, false);
1311 Constant* CPV = dyn_cast<Constant>(Operand);
1313 if (CPV && !isa<GlobalValue>(CPV))
1314 printConstant(CPV, Static);