aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-06 02:44:09 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-06 02:44:09 +0000
commitb2bcf1c176b200b36f371e189ce22f93c86cdf45 (patch)
treee5fff0b1f46541f23f7d1df3991ec981a0f313d3 /lib/CodeGen/CodeGenModule.cpp
parent1610b8198e31eb6d77d4d6904d6af88ef5cc6d3b (diff)
Use the correct function info for constructors when applying function attributes. Fixes PR6245.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index c3f5443c47..fc5989fa9a 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -409,11 +409,13 @@ void CodeGenModule::SetInternalFunctionAttributes(const Decl *D,
SetCommonAttributes(D, F);
}
-void CodeGenModule::SetFunctionAttributes(const FunctionDecl *FD,
+void CodeGenModule::SetFunctionAttributes(GlobalDecl GD,
llvm::Function *F,
bool IsIncompleteFunction) {
+ const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl());
+
if (!IsIncompleteFunction)
- SetLLVMFunctionAttributes(FD, getTypes().getFunctionInfo(FD), F);
+ SetLLVMFunctionAttributes(FD, getTypes().getFunctionInfo(GD), F);
// Only a few attributes are set on declarations; these may later be
// overridden by a definition.
@@ -732,8 +734,7 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction(const char *MangledName,
"", &getModule());
F->setName(MangledName);
if (D.getDecl())
- SetFunctionAttributes(cast<FunctionDecl>(D.getDecl()), F,
- IsIncompleteFunction);
+ SetFunctionAttributes(D, F, IsIncompleteFunction);
Entry = F;
// This is the first use or definition of a mangled name. If there is a