Skip to content

Commit c1cf419

Browse files
committed
[clang] Fix missing target info specifier on Global Variable linkage computation
A previous change (#10555) added support for querying 'isWeakImported' to be parameterized on the enclosing target version to match 'CheckAvailability' and 'getAvailability'. We missed passing in this parameter in the Clang module code-gen when querying linkage for a global variable. This change adds the missing parameter and removes the default parameter from the query in order to avoid this kind of bug in the future. Resolves rdar://154677999
1 parent 30770f0 commit c1cf419

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,7 +2759,7 @@ void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD,
27592759
}
27602760

27612761
static void setLinkageForGV(llvm::GlobalValue *GV, const NamedDecl *ND,
2762-
VersionTuple EnclosingVersion = VersionTuple()) {
2762+
VersionTuple EnclosingVersion) {
27632763
// Set linkage and visibility in case we never see a definition.
27642764
LinkageInfo LV = ND->getLinkageAndVisibility();
27652765
// Don't set internal linkage on declarations.
@@ -5003,7 +5003,7 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, llvm::Type *Ty,
50035003

50045004
GV->setAlignment(getContext().getDeclAlign(D).getAsAlign());
50055005

5006-
setLinkageForGV(GV, D);
5006+
setLinkageForGV(GV, D, Target.getPlatformMinVersion());
50075007

50085008
if (D->getTLSKind()) {
50095009
if (D->getTLSKind() == VarDecl::TLS_Dynamic)

0 commit comments

Comments
 (0)