Skip to content

Commit 75c649c

Browse files
committed
Pass a GlobalDecl to SetCommonAttributes. NFC.
Part of D43900. llvm-svn: 326392
1 parent e4e7813 commit 75c649c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,8 +1232,8 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
12321232
CreateFunctionTypeMetadata(FD, F);
12331233
}
12341234

1235-
void CodeGenModule::SetCommonAttributes(const Decl *D,
1236-
llvm::GlobalValue *GV) {
1235+
void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
1236+
const Decl *D = GD.getDecl();
12371237
if (const auto *ND = dyn_cast_or_null<NamedDecl>(D))
12381238
setGVProperties(GV, ND);
12391239
else
@@ -1245,7 +1245,7 @@ void CodeGenModule::SetCommonAttributes(const Decl *D,
12451245

12461246
void CodeGenModule::setAliasAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
12471247
const Decl *D = GD.getDecl();
1248-
SetCommonAttributes(D, GV);
1248+
SetCommonAttributes(GD, GV);
12491249

12501250
// Process the dllexport attribute based on whether the original definition
12511251
// (not necessarily the aliasee) was exported.
@@ -1302,7 +1302,7 @@ bool CodeGenModule::GetCPUAndFeaturesAttributes(const Decl *D,
13021302
void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
13031303
llvm::GlobalObject *GO) {
13041304
const Decl *D = GD.getDecl();
1305-
SetCommonAttributes(D, GO);
1305+
SetCommonAttributes(GD, GO);
13061306

13071307
if (D) {
13081308
if (auto *GV = dyn_cast<llvm::GlobalVariable>(GO)) {
@@ -3731,7 +3731,7 @@ void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) {
37313731
} else
37323732
GIF->setName(MangledName);
37333733

3734-
SetCommonAttributes(D, GIF);
3734+
SetCommonAttributes(GD, GIF);
37353735
}
37363736

37373737
llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,

clang/lib/CodeGen/CodeGenModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ class CodeGenModule : public CodeGenTypeCache {
11881188
/// Objective-C method, function, global variable).
11891189
///
11901190
/// NOTE: This should only be called for definitions.
1191-
void SetCommonAttributes(const Decl *D, llvm::GlobalValue *GV);
1191+
void SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV);
11921192

11931193
/// Set attributes which must be preserved by an alias. This includes common
11941194
/// attributes (i.e. it includes a call to SetCommonAttributes).

0 commit comments

Comments
 (0)