Skip to content

Commit 50d6b19

Browse files
committed
IRGen: use named IRLinkage a bit more (NFC)
Use the `IRLInkage::InternalLinkOnceODR` linkage rather than computing that in a couple of sites. This gives us semantic meaning to the linkage being applied. NFC.
1 parent 3f4990d commit 50d6b19

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

lib/IRGen/GenReflection.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,7 @@ llvm::Constant *IRGenModule::getMangledAssociatedConformance(
230230
llvm::GlobalValue::LinkOnceODRLinkage,
231231
nullptr,
232232
symbolName);
233-
ApplyIRLinkage({llvm::GlobalValue::LinkOnceODRLinkage,
234-
llvm::GlobalValue::HiddenVisibility,
235-
llvm::GlobalValue::DefaultStorageClass})
236-
.to(var);
233+
ApplyIRLinkage(IRLinkage::InternalLinkOnceODR).to(var);
237234
var->setAlignment(2);
238235
setTrueConstGlobal(var);
239236
var->setSection(getReflectionTypeRefSectionName());

lib/IRGen/MetadataRequest.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,7 @@ llvm::Constant *IRGenModule::getAddrOfStringForMetadataRef(
248248
nullptr,
249249
symbolName);
250250

251-
ApplyIRLinkage({llvm::GlobalValue::LinkOnceODRLinkage,
252-
llvm::GlobalValue::HiddenVisibility,
253-
llvm::GlobalValue::DefaultStorageClass})
254-
.to(var);
251+
ApplyIRLinkage(IRLinkage::InternalLinkOnceODR).to(var);
255252
if (alignment)
256253
var->setAlignment(alignment);
257254
setTrueConstGlobal(var);

0 commit comments

Comments
 (0)