As per Chris' request, return the Instruction from EmitCall and add the metadata in the caller.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Chisnall 2010-05-02 13:41:58 +00:00
Родитель 06a9f3680d
Коммит 4b02afcb45
3 изменённых файлов: 12 добавлений и 9 удалений

Просмотреть файл

@ -870,8 +870,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
ReturnValueSlot ReturnValue,
const CallArgList &CallArgs,
const Decl *TargetDecl,
unsigned MDKind,
llvm::MDNode *Metadata) {
llvm::Instruction **callOrInvoke) {
// FIXME: We no longer need the types from CallArgs; lift up and simplify.
llvm::SmallVector<llvm::Value*, 16> Args;
@ -997,8 +996,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
Args.data(), Args.data()+Args.size());
EmitBlock(Cont);
}
if (Metadata) {
CS->setMetadata(MDKind, Metadata);
if (callOrInvoke) {
*callOrInvoke = CS.getInstruction();
}
CS.setAttributes(Attrs);

Просмотреть файл

@ -566,8 +566,11 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,
};
llvm::MDNode *node = llvm::MDNode::get(VMContext, impMD, 3);
return CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs,
0, msgSendMDKind, node);
llvm::Instruction *call;
RValue msgRet = CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs,
0, &call);
call->setMetadata(msgSendMDKind, node);
return msgRet;
}
/// Generate code for a message send expression.
@ -707,8 +710,10 @@ CGObjCGNU::GenerateMessageSend(CodeGen::CodeGenFunction &CGF,
imp = Builder.CreateCall2(lookupFunction, Receiver, cmd);
cast<llvm::CallInst>(imp)->setMetadata(msgSendMDKind, node);
}
llvm::Instruction *call;
RValue msgRet = CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs,
0, msgSendMDKind, node);
0, &call);
call->setMetadata(msgSendMDKind, node);
if (!isPointerSizedReturn) {
CGF.EmitBlock(contiueBB);

Просмотреть файл

@ -1114,8 +1114,7 @@ public:
ReturnValueSlot ReturnValue,
const CallArgList &Args,
const Decl *TargetDecl = 0,
unsigned MDKind = 0,
llvm::MDNode *Metadata = 0);
llvm::Instruction **callOrInvoke = 0);
RValue EmitCall(QualType FnType, llvm::Value *Callee,
ReturnValueSlot ReturnValue,