зеркало из https://github.com/microsoft/clang-1.git
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:
Родитель
06a9f3680d
Коммит
4b02afcb45
|
@ -870,8 +870,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
|
||||||
ReturnValueSlot ReturnValue,
|
ReturnValueSlot ReturnValue,
|
||||||
const CallArgList &CallArgs,
|
const CallArgList &CallArgs,
|
||||||
const Decl *TargetDecl,
|
const Decl *TargetDecl,
|
||||||
unsigned MDKind,
|
llvm::Instruction **callOrInvoke) {
|
||||||
llvm::MDNode *Metadata) {
|
|
||||||
// FIXME: We no longer need the types from CallArgs; lift up and simplify.
|
// FIXME: We no longer need the types from CallArgs; lift up and simplify.
|
||||||
llvm::SmallVector<llvm::Value*, 16> Args;
|
llvm::SmallVector<llvm::Value*, 16> Args;
|
||||||
|
|
||||||
|
@ -997,8 +996,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
|
||||||
Args.data(), Args.data()+Args.size());
|
Args.data(), Args.data()+Args.size());
|
||||||
EmitBlock(Cont);
|
EmitBlock(Cont);
|
||||||
}
|
}
|
||||||
if (Metadata) {
|
if (callOrInvoke) {
|
||||||
CS->setMetadata(MDKind, Metadata);
|
*callOrInvoke = CS.getInstruction();
|
||||||
}
|
}
|
||||||
|
|
||||||
CS.setAttributes(Attrs);
|
CS.setAttributes(Attrs);
|
||||||
|
|
|
@ -566,8 +566,11 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,
|
||||||
};
|
};
|
||||||
llvm::MDNode *node = llvm::MDNode::get(VMContext, impMD, 3);
|
llvm::MDNode *node = llvm::MDNode::get(VMContext, impMD, 3);
|
||||||
|
|
||||||
return CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs,
|
llvm::Instruction *call;
|
||||||
0, msgSendMDKind, node);
|
RValue msgRet = CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs,
|
||||||
|
0, &call);
|
||||||
|
call->setMetadata(msgSendMDKind, node);
|
||||||
|
return msgRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Generate code for a message send expression.
|
/// Generate code for a message send expression.
|
||||||
|
@ -707,8 +710,10 @@ CGObjCGNU::GenerateMessageSend(CodeGen::CodeGenFunction &CGF,
|
||||||
imp = Builder.CreateCall2(lookupFunction, Receiver, cmd);
|
imp = Builder.CreateCall2(lookupFunction, Receiver, cmd);
|
||||||
cast<llvm::CallInst>(imp)->setMetadata(msgSendMDKind, node);
|
cast<llvm::CallInst>(imp)->setMetadata(msgSendMDKind, node);
|
||||||
}
|
}
|
||||||
|
llvm::Instruction *call;
|
||||||
RValue msgRet = CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs,
|
RValue msgRet = CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs,
|
||||||
0, msgSendMDKind, node);
|
0, &call);
|
||||||
|
call->setMetadata(msgSendMDKind, node);
|
||||||
|
|
||||||
if (!isPointerSizedReturn) {
|
if (!isPointerSizedReturn) {
|
||||||
CGF.EmitBlock(contiueBB);
|
CGF.EmitBlock(contiueBB);
|
||||||
|
|
|
@ -1114,8 +1114,7 @@ public:
|
||||||
ReturnValueSlot ReturnValue,
|
ReturnValueSlot ReturnValue,
|
||||||
const CallArgList &Args,
|
const CallArgList &Args,
|
||||||
const Decl *TargetDecl = 0,
|
const Decl *TargetDecl = 0,
|
||||||
unsigned MDKind = 0,
|
llvm::Instruction **callOrInvoke = 0);
|
||||||
llvm::MDNode *Metadata = 0);
|
|
||||||
|
|
||||||
RValue EmitCall(QualType FnType, llvm::Value *Callee,
|
RValue EmitCall(QualType FnType, llvm::Value *Callee,
|
||||||
ReturnValueSlot ReturnValue,
|
ReturnValueSlot ReturnValue,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче