]> granicus.if.org Git - clang/commitdiff
Pass a GlobalDecl to setAliasAttributes. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 28 Feb 2018 00:06:01 +0000 (00:06 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 28 Feb 2018 00:06:01 +0000 (00:06 +0000)
This just makes a followup change easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326270 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXX.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
lib/CodeGen/ItaniumCXXABI.cpp

index d50e4bc0551514bb7101e933a1b2b76f315b0fae..e56be9c403aad0a52dcf6310e0468b041bb4d913 100644 (file)
@@ -205,7 +205,7 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl,
   }
 
   // Finally, set up the alias with its proper name and attributes.
-  setAliasAttributes(cast<NamedDecl>(AliasDecl.getDecl()), Alias);
+  setAliasAttributes(AliasDecl, Alias);
 
   return false;
 }
index 36a0b9e9e4f2eaca0d440a7f26d5681a5e3d873e..56eb8ada481116c998199bb4ecea242580385cbb 100644 (file)
@@ -1248,8 +1248,8 @@ void CodeGenModule::SetCommonAttributes(const Decl *D,
     addUsedGlobal(GV);
 }
 
-void CodeGenModule::setAliasAttributes(const Decl *D,
-                                       llvm::GlobalValue *GV) {
+void CodeGenModule::setAliasAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
+  const Decl *D = GD.getDecl();
   SetCommonAttributes(D, GV);
 
   // Process the dllexport attribute based on whether the original definition
@@ -3675,7 +3675,7 @@ void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) {
     if (VD->getTLSKind())
       setTLSMode(GA, *VD);
 
-  setAliasAttributes(D, GA);
+  setAliasAttributes(GD, GA);
 }
 
 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) {
index 40a9d93241176d96e07b36e1d1b6991b8156b379..85018caa4281e5af0623e9b3e1a814a9c64adcf2 100644 (file)
@@ -1197,7 +1197,7 @@ public:
   /// attributes (i.e. it includes a call to SetCommonAttributes).
   ///
   /// NOTE: This should only be called for definitions.
-  void setAliasAttributes(const Decl *D, llvm::GlobalValue *GV);
+  void setAliasAttributes(GlobalDecl GD, llvm::GlobalValue *GV);
 
   void addReplacement(StringRef Name, llvm::Constant *C);
 
index 6e202ddd35ecb07a14cce01708a30111934b5a49..6254f359d596a6465b7299ae2b85f06b20cfefd8 100644 (file)
@@ -3637,7 +3637,7 @@ static void emitConstructorDestructorAlias(CodeGenModule &CGM,
   }
 
   // Finally, set up the alias with its proper name and attributes.
-  CGM.setAliasAttributes(cast<NamedDecl>(AliasDecl.getDecl()), Alias);
+  CGM.setAliasAttributes(AliasDecl, Alias);
 }
 
 void ItaniumCXXABI::emitCXXStructor(const CXXMethodDecl *MD,