From: Rafael Espindola Date: Thu, 1 Mar 2018 00:06:55 +0000 (+0000) Subject: Pass a GlobalDecl to SetCommonAttributes. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=efbf5941f71c2867be499c59a5ba248620b08c32;p=clang Pass a GlobalDecl to SetCommonAttributes. NFC. Part of D43900. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326392 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 21dbcf3061..b157f5aff2 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1232,8 +1232,8 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, 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(D)) setGVProperties(GV, ND); else @@ -1245,7 +1245,7 @@ void CodeGenModule::SetCommonAttributes(const Decl *D, 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::GetCPUAndFeaturesAttributes(const Decl *D, 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(GO)) { @@ -3731,7 +3731,7 @@ void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) { } else GIF->setName(MangledName); - SetCommonAttributes(D, GIF); + SetCommonAttributes(GD, GIF); } llvm::Function *CodeGenModule::getIntrinsic(unsigned IID, diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 19fbb22678..29478c5ed8 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -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).