diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index fad3034f4d6..749578c91ad 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1082,7 +1082,7 @@ llvm::ConstantInt *CodeGenModule::CreateCrossDsoCfiTypeId(llvm::Metadata *MD) { void CodeGenModule::setFunctionDefinitionAttributes(GlobalDecl GD, llvm::Function *F) { - setNonAliasAttributes(GD.getDecl(), F); + setNonAliasAttributes(GD, F); } void CodeGenModule::SetLLVMFunctionAttributes(const Decl *D, @@ -1304,8 +1304,9 @@ bool CodeGenModule::GetCPUAndFeaturesAttributes(const Decl *D, return AddedAttr; } -void CodeGenModule::setNonAliasAttributes(const Decl *D, +void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, llvm::GlobalObject *GO) { + const Decl *D = GD.getDecl(); SetCommonAttributes(D, GO); if (D) { @@ -1350,7 +1351,7 @@ void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD, F->setLinkage(llvm::Function::InternalLinkage); - setNonAliasAttributes(D, F); + setNonAliasAttributes(GD, F); } static void setLinkageForGV(llvm::GlobalValue *GV, diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 3baae9ef5b7..71b130b0be3 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1277,7 +1277,7 @@ private: bool GetCPUAndFeaturesAttributes(const Decl *D, llvm::AttrBuilder &AttrBuilder); - void setNonAliasAttributes(const Decl *D, llvm::GlobalObject *GO); + void setNonAliasAttributes(GlobalDecl GD, llvm::GlobalObject *GO); /// Set function attributes for a function declaration. void SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, |