llvm.org GIT mirror llvm / fc91e7d
resort to ArgOperand API git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106942 91177308-0d34-0410-b5e6-96231b3b80d8 Gabor Greif 9 years ago
1 changed file(s) with 8 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
11331133 Vals.push_back(cast(I).isVolatile());
11341134 break;
11351135 case Instruction::Call: {
1136 const PointerType *PTy = cast(I.getOperand(0)->getType());
1136 const CallInst &CI = cast(I);
1137 const PointerType *PTy = cast(CI.getCalledValue()->getType());
11371138 const FunctionType *FTy = cast(PTy->getElementType());
11381139
11391140 Code = bitc::FUNC_CODE_INST_CALL;
11401141
1141 const CallInst *CI = cast(&I);
1142 Vals.push_back(VE.getAttributeID(CI->getAttributes()));
1143 Vals.push_back((CI->getCallingConv() << 1) | unsigned(CI->isTailCall()));
1144 PushValueAndType(CI->getOperand(0), InstID, Vals, VE); // Callee
1142 Vals.push_back(VE.getAttributeID(CI.getAttributes()));
1143 Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall()));
1144 PushValueAndType(CI.getCalledValue(), InstID, Vals, VE); // Callee
11451145
11461146 // Emit value #'s for the fixed parameters.
11471147 for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i)
1148 Vals.push_back(VE.getValueID(I.getOperand(i+1))); // fixed param.
1148 Vals.push_back(VE.getValueID(CI.getArgOperand(i))); // fixed param.
11491149
11501150 // Emit type/value pairs for varargs params.
11511151 if (FTy->isVarArg()) {
1152 unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams();
1153 for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands();
1152 for (unsigned i = FTy->getNumParams(), e = CI.getNumArgOperands();
11541153 i != e; ++i)
1155 PushValueAndType(I.getOperand(i), InstID, Vals, VE); // varargs
1154 PushValueAndType(CI.getArgOperand(i), InstID, Vals, VE); // varargs
11561155 }
11571156 break;
11581157 }