diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-06 02:44:09 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-06 02:44:09 +0000 |
commit | 6710c5351e56a7deafd35e99ea663e9dc9aca161 (patch) | |
tree | 2d082f9c9503c24dd1fa85baa0cdbc4f5a3119f4 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 0a741b7258bc1050cafc91462e41dd1fbfe48f0c (diff) | |
download | bcm5719-llvm-6710c5351e56a7deafd35e99ea663e9dc9aca161.tar.gz bcm5719-llvm-6710c5351e56a7deafd35e99ea663e9dc9aca161.zip |
Use the correct function info for constructors when applying function attributes. Fixes PR6245.
llvm-svn: 95474
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c3f5443c47b..fc5989fa9a4 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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 |