Skip to content

Commit 8466ef6

Browse files
committed
Serialization: allow IS_STATIC_LIBRARY to be deserialised properly
Properly encode the field metadata to permit the deserialization by `llvm-bcanalyzer` for aiding debugging.
1 parent 4d72501 commit 8466ef6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/Serialization/Serialization.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ void Serializer::writeBlockInfoBlock() {
837837
BLOCK_RECORD(options_block, SDK_PATH);
838838
BLOCK_RECORD(options_block, XCC);
839839
BLOCK_RECORD(options_block, IS_SIB);
840+
BLOCK_RECORD(options_block, IS_STATIC_LIBRARY);
840841
BLOCK_RECORD(options_block, IS_TESTABLE);
841842
BLOCK_RECORD(options_block, ARE_PRIVATE_IMPORTS_ENABLED);
842843
BLOCK_RECORD(options_block, RESILIENCE_STRATEGY);

test/Serialization/static.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %target-swift-frontend -emit-module -o %t %s
4+
// RUN: llvm-bcanalyzer -dump %t/static.swiftmodule | %FileCheck %s -check-prefix CHECK -check-prefix DYNAMIC
5+
6+
// RUN: %target-swift-frontend -static -emit-module -o %t %s
7+
// RUN: llvm-bcanalyzer -dump %t/static.swiftmodule | %FileCheck %s -check-prefix CHECK -check-prefix STATIC
8+
9+
// CHECK: <MODULE_BLOCK {{.*}}>
10+
// CHECK-STATIC: <IS_STATIC abbrevid={{[0-9]+}}/>
11+
// CHECK-DYNAMIC-NOT: <IS_STATIC abbrevid={{[0-9]+}}/>
12+
// CHECK: </MODULE_BLOCK>

0 commit comments

Comments
 (0)