Set call attribute for direct calls (i.e. noreturn).
- Remove an unused variant of EmitCallExpr overload.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65130 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 42f671a..d0122fa 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1676,7 +1676,8 @@
RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
llvm::Value *Callee,
- const CallArgList &CallArgs) {
+ const CallArgList &CallArgs,
+ const Decl *TargetDecl) {
// FIXME: We no longer need the types from CallArgs; lift up and
// simplify.
llvm::SmallVector<llvm::Value*, 16> Args;
@@ -1752,9 +1753,8 @@
llvm::CallInst *CI = Builder.CreateCall(Callee,&Args[0],&Args[0]+Args.size());
- // FIXME: Provide TargetDecl so nounwind, noreturn, etc, etc get set.
CodeGen::AttributeListType AttributeList;
- CGM.ConstructAttributeList(CallInfo, 0, AttributeList);
+ CGM.ConstructAttributeList(CallInfo, TargetDecl, AttributeList);
CI->setAttributes(llvm::AttrListPtr::get(AttributeList.begin(),
AttributeList.size()));