[CodeGen] Call SetInternalFunctionAttributes to attach function

attributes to internal functions.

This patch fixes CodeGenModule::CreateGlobalInitOrDestructFunction to
use SetInternalFunctionAttributes instead of SetLLVMFunctionAttributes
to attach function attributes to internal functions.

Also, make sure the correct CGFunctionInfo is passed instead of always
passing what arrangeNullaryFunction returns.

rdar://problem/20828324

Differential Revision: http://reviews.llvm.org/D13610

llvm-svn: 251734
This commit is contained in:
Akira Hatanaka
2015-10-31 01:28:07 +00:00
parent dbb0abbf47
commit 7791f1a4a9
6 changed files with 38 additions and 16 deletions

View File

@@ -686,6 +686,7 @@ public:
llvm::Function *
CreateGlobalInitOrDestructFunction(llvm::FunctionType *ty, const Twine &name,
const CGFunctionInfo &FI,
SourceLocation Loc = SourceLocation(),
bool TLS = false);