Serialization: allow IS_STATIC_LIBRARY to be deserialised properly

Properly encode the field metadata to permit the deserialization by
`llvm-bcanalyzer` for aiding debugging.
This commit is contained in:
Saleem Abdulrasool
2023-07-18 10:27:09 -07:00
parent 4d72501d32
commit 8466ef6d80
2 changed files with 13 additions and 0 deletions

View File

@@ -837,6 +837,7 @@ void Serializer::writeBlockInfoBlock() {
BLOCK_RECORD(options_block, SDK_PATH);
BLOCK_RECORD(options_block, XCC);
BLOCK_RECORD(options_block, IS_SIB);
BLOCK_RECORD(options_block, IS_STATIC_LIBRARY);
BLOCK_RECORD(options_block, IS_TESTABLE);
BLOCK_RECORD(options_block, ARE_PRIVATE_IMPORTS_ENABLED);
BLOCK_RECORD(options_block, RESILIENCE_STRATEGY);

View File

@@ -0,0 +1,12 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t %s
// RUN: llvm-bcanalyzer -dump %t/static.swiftmodule | %FileCheck %s -check-prefix CHECK -check-prefix DYNAMIC
// RUN: %target-swift-frontend -static -emit-module -o %t %s
// RUN: llvm-bcanalyzer -dump %t/static.swiftmodule | %FileCheck %s -check-prefix CHECK -check-prefix STATIC
// CHECK: <MODULE_BLOCK {{.*}}>
// CHECK-STATIC: <IS_STATIC abbrevid={{[0-9]+}}/>
// CHECK-DYNAMIC-NOT: <IS_STATIC abbrevid={{[0-9]+}}/>
// CHECK: </MODULE_BLOCK>