From 2eeb108d59c1610850655bfe1dfd1b7647b5f5dc Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 28 Feb 2018 00:06:01 +0000 Subject: [PATCH] Pass a GlobalDecl to setAliasAttributes. NFC. 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 | 2 +- lib/CodeGen/CodeGenModule.cpp | 6 +++--- lib/CodeGen/CodeGenModule.h | 2 +- lib/CodeGen/ItaniumCXXABI.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index d50e4bc055..e56be9c403 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -205,7 +205,7 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl, } // Finally, set up the alias with its proper name and attributes. - setAliasAttributes(cast(AliasDecl.getDecl()), Alias); + setAliasAttributes(AliasDecl, Alias); return false; } diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 36a0b9e9e4..56eb8ada48 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -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) { diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 40a9d93241..85018caa42 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -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); diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index 6e202ddd35..6254f359d5 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/lib/CodeGen/ItaniumCXXABI.cpp @@ -3637,7 +3637,7 @@ static void emitConstructorDestructorAlias(CodeGenModule &CGM, } // Finally, set up the alias with its proper name and attributes. - CGM.setAliasAttributes(cast(AliasDecl.getDecl()), Alias); + CGM.setAliasAttributes(AliasDecl, Alias); } void ItaniumCXXABI::emitCXXStructor(const CXXMethodDecl *MD, -- 2.40.0