r326265 - Pass a GlobalDecl to setFunctionDefinitionAttributes. NFC.

Rafael Espindola via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 15:44:36 PST 2018


Author: rafael
Date: Tue Feb 27 15:44:36 2018
New Revision: 326265

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

This just makes a followup patch easier to read.

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

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=326265&r1=326264&r2=326265&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Tue Feb 27 15:44:36 2018
@@ -230,7 +230,7 @@ llvm::Function *CodeGenModule::codegenCX
   setFunctionDLLStorageClass(GD, Fn);
 
   CodeGenFunction(*this).GenerateCode(GD, Fn, FnInfo);
-  setFunctionDefinitionAttributes(MD, Fn);
+  setFunctionDefinitionAttributes(GD, Fn);
   SetLLVMFunctionAttributesForDefinition(MD, Fn);
   return Fn;
 }

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=326265&r1=326264&r2=326265&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Feb 27 15:44:36 2018
@@ -1080,9 +1080,9 @@ llvm::ConstantInt *CodeGenModule::Create
   return llvm::ConstantInt::get(Int64Ty, llvm::MD5Hash(MDS->getString()));
 }
 
-void CodeGenModule::setFunctionDefinitionAttributes(const FunctionDecl *D,
+void CodeGenModule::setFunctionDefinitionAttributes(GlobalDecl GD,
                                                     llvm::Function *F) {
-  setNonAliasAttributes(D, F);
+  setNonAliasAttributes(GD.getDecl(), F);
 }
 
 void CodeGenModule::SetLLVMFunctionAttributes(const Decl *D,
@@ -3591,7 +3591,7 @@ void CodeGenModule::EmitGlobalFunctionDe
 
   CodeGenFunction(*this).GenerateCode(D, Fn, FI);
 
-  setFunctionDefinitionAttributes(D, Fn);
+  setFunctionDefinitionAttributes(GD, Fn);
   SetLLVMFunctionAttributesForDefinition(D, Fn);
 
   if (const ConstructorAttr *CA = D->getAttr<ConstructorAttr>())

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=326265&r1=326264&r2=326265&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Tue Feb 27 15:44:36 2018
@@ -1183,8 +1183,7 @@ public:
   bool TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D);
 
   /// Set attributes for a global definition.
-  void setFunctionDefinitionAttributes(const FunctionDecl *D,
-                                       llvm::Function *F);
+  void setFunctionDefinitionAttributes(GlobalDecl GD, llvm::Function *F);
 
   llvm::GlobalValue *GetGlobalValue(StringRef Ref);
 




More information about the cfe-commits mailing list