Skip to content

Commit 6631631

Browse files
authored
Merge pull request swiftlang#13977 from slavapestov/remove-dead-hack
Serialization: Remove some apparently dead code
2 parents eae413d + 7eb0519 commit 6631631

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

lib/Serialization/SerializeSIL.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -353,19 +353,6 @@ void SILSerializer::writeSILFunction(const SILFunction &F, bool DeclOnly) {
353353

354354
SILLinkage Linkage = F.getLinkage();
355355

356-
// We serialize shared_external linkage as shared since:
357-
//
358-
// 1. shared_external linkage is just a hack to tell the optimizer that a
359-
// shared function was deserialized.
360-
//
361-
// 2. We cannot just serialize a declaration to a shared_external function
362-
// since shared_external functions still have linkonce_odr linkage at the LLVM
363-
// level. This means they must be defined not just declared.
364-
//
365-
// TODO: When serialization is reworked, this should be removed.
366-
if (hasSharedVisibility(Linkage))
367-
Linkage = SILLinkage::Shared;
368-
369356
// Check if we need to emit a body for this function.
370357
bool NoBody = DeclOnly || isAvailableExternally(Linkage) ||
371358
F.isExternalDeclaration();

test/SIL/Serialization/visibility.sil

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ import Builtin
3434
// CHECK-DAG: sil [serialized] @public_function_test : $@convention(thin) () -> () {
3535
// CHECK-DAG: sil [serialized] @public_function : $@convention(thin) () -> () {
3636
// CHECK-DAG: sil hidden [serialized] @hidden_function : $@convention(thin) () -> () {
37-
// NEG-CHECK-NOT: sil shared_external [serialized] @shared_external_function_test : $@convention(thin) () -> ()
38-
// CHECK-DAG: sil shared [serialized] @shared_external_function_test : $@convention(thin) () -> ()
37+
// CHECK-DAG: sil shared_external [serialized] @shared_external_function_test : $@convention(thin) () -> ()
3938

4039
sil_global private [serialized] @private_global : $Builtin.Word
4140
sil_global [serialized] @public_global : $Builtin.Word

0 commit comments

Comments
 (0)