r326392 - Pass a GlobalDecl to SetCommonAttributes. NFC.

Rafael Espindola via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 16:06:55 PST 2018


Author: rafael
Date: Wed Feb 28 16:06:55 2018
New Revision: 326392

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

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=326392&r1=326391&r2=326392&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Wed Feb 28 16:06:55 2018
@@ -1232,8 +1232,8 @@ void CodeGenModule::SetLLVMFunctionAttri
       CreateFunctionTypeMetadata(FD, F);
 }
 
-void CodeGenModule::SetCommonAttributes(const Decl *D,
-                                        llvm::GlobalValue *GV) {
+void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
+  const Decl *D = GD.getDecl();
   if (const auto *ND = dyn_cast_or_null<NamedDecl>(D))
     setGVProperties(GV, ND);
   else
@@ -1245,7 +1245,7 @@ void CodeGenModule::SetCommonAttributes(
 
 void CodeGenModule::setAliasAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
   const Decl *D = GD.getDecl();
-  SetCommonAttributes(D, GV);
+  SetCommonAttributes(GD, GV);
 
   // Process the dllexport attribute based on whether the original definition
   // (not necessarily the aliasee) was exported.
@@ -1302,7 +1302,7 @@ bool CodeGenModule::GetCPUAndFeaturesAtt
 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
                                           llvm::GlobalObject *GO) {
   const Decl *D = GD.getDecl();
-  SetCommonAttributes(D, GO);
+  SetCommonAttributes(GD, GO);
 
   if (D) {
     if (auto *GV = dyn_cast<llvm::GlobalVariable>(GO)) {
@@ -3731,7 +3731,7 @@ void CodeGenModule::emitIFuncDefinition(
   } else
     GIF->setName(MangledName);
 
-  SetCommonAttributes(D, GIF);
+  SetCommonAttributes(GD, GIF);
 }
 
 llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=326392&r1=326391&r2=326392&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Wed Feb 28 16:06:55 2018
@@ -1188,7 +1188,7 @@ public:
   /// Objective-C method, function, global variable).
   ///
   /// NOTE: This should only be called for definitions.
-  void SetCommonAttributes(const Decl *D, llvm::GlobalValue *GV);
+  void SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV);
 
   /// Set attributes which must be preserved by an alias. This includes common
   /// attributes (i.e. it includes a call to SetCommonAttributes).




More information about the cfe-commits mailing list