r326388 - Pass a GlobalDecl to setNonAliasAttributes. NFC.

Rafael Espindola via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 15:54:23 PST 2018


Author: rafael
Date: Wed Feb 28 15:54:23 2018
New Revision: 326388

URL: http://llvm.org/viewvc/llvm-project?rev=326388&view=rev
Log:
Pass a GlobalDecl to setNonAliasAttributes. NFC.

Also part of D43900.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.h

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=326388&r1=326387&r2=326388&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Wed Feb 28 15:54:23 2018
@@ -1082,7 +1082,7 @@ llvm::ConstantInt *CodeGenModule::Create
 
 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::GetCPUAndFeaturesAtt
   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::SetInternalFunctionA
 
   F->setLinkage(llvm::Function::InternalLinkage);
 
-  setNonAliasAttributes(D, F);
+  setNonAliasAttributes(GD, F);
 }
 
 static void setLinkageForGV(llvm::GlobalValue *GV,

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=326388&r1=326387&r2=326388&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Wed Feb 28 15:54:23 2018
@@ -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,




More information about the cfe-commits mailing list