Skip to content

Commit ffcbdc6

Browse files
committed
Make it LinkOnceODRLinkage
Make the little variable LinkOnceODRLinkage so that it doesn't take up as much space.
1 parent 7af551c commit ffcbdc6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,9 +1786,10 @@ void IRGenModule::emitSwiftAsyncExtendedFrameInfoWeakRef() {
17861786
// avoid optimizations.
17871787
llvm::GlobalVariable *usage = new llvm::GlobalVariable(
17881788
Module, extendedFramePointerFlagsWeakRef->getType(), false,
1789-
llvm::GlobalValue::PrivateLinkage,
1789+
llvm::GlobalValue::LinkOnceODRLinkage,
17901790
static_cast<llvm::GlobalVariable *>(extendedFramePointerFlagsWeakRef),
17911791
"_swift_async_extendedFramePointerFlagsUser");
1792+
usage->setVisibility(llvm::GlobalValue::HiddenVisibility);
17921793
addUsedGlobal(usage);
17931794
}
17941795

test/Concurrency/Backdeploy/weak_linking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// OLD: declare extern_weak swiftcc i8 @"$sScP8rawValues5UInt8Vvg"
1717

1818
// OPTIMIZED: @swift_async_extendedFramePointerFlags = extern_weak global i8*
19-
// OPTIMIZED: @_swift_async_extendedFramePointerFlagsUser = private global i8** @swift_async_extendedFramePointerFlags
19+
// OPTIMIZED: @_swift_async_extendedFramePointerFlagsUser = linkonce_odr hidden global i8** @swift_async_extendedFramePointerFlags
2020
// OPTIMIZED: @llvm.used =
2121
// OPTIMIZED-SAME: (i8*** @_swift_async_extendedFramePointerFlagsUser to i8*)
2222

0 commit comments

Comments
 (0)