本文整理汇总了C++中CallArgList::addFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ CallArgList::addFrom方法的具体用法?C++ CallArgList::addFrom怎么用?C++ CallArgList::addFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CallArgList
的用法示例。
在下文中一共展示了CallArgList::addFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSelector
CodeGen::RValue
CGObjCJit::EmitMessageSend(CodeGen::CodeGenFunction &CGF,
ReturnValueSlot Return,
QualType ResultType,
Selector Sel,
llvm::Value *Arg0,
llvm::Value *Arg0Class,
const CallArgList &CallArgs,
const ObjCMethodDecl *Method) {
llvm::Value *Arg1 = GetSelector(CGF, Sel);
CallArgList ActualArgs;
ActualArgs.add(RValue::get(Arg0), CGF.getContext().getObjCIdType());
ActualArgs.add(RValue::get(Arg1), CGF.getContext().getObjCSelType());
ActualArgs.addFrom(CallArgs);
if (Method)
assert(CGM.getContext().getCanonicalType(Method->getResultType()) ==
CGM.getContext().getCanonicalType(ResultType) &&
"Result type mismatch!");
// Perform the following:
// imp = class_getMethodImplementation( Arg0Class, Arg1 );
// (*imp)( Arg0, Arg1, CallArgs );
llvm::CallInst *getImp;
// Unfortunately, using the GNU runtime version of
// class_getMethodImplementation and then calling the resulting
// IMP doesn't work unless objc_msg_lookup was already
// called first. TODO: avoid doing this every time
//
if (fn_objc_msg_lookup.isValid()) {
getImp = CGF.Builder.CreateCall2(fn_objc_msg_lookup,
Arg0,
Arg1);
} else { // use the universal way
getImp = CGF.Builder.CreateCall2(fn_class_getMethodImplementation,
Arg0Class,
Arg1);
}
MessageSendInfo MSI = getMessageSendInfo(Method, ResultType, ActualArgs);
llvm::Value *theImp = CGF.Builder.CreateBitCast(getImp, MSI.MessengerType);
return CGF.EmitCall(MSI.CallInfo, theImp, Return, ActualArgs);
}