Add the -enable-testing flag, and serialize it.

This flag indicates that internal APIs within the module should be made
available to client code for testing purposes. Currently does nothing.

Not ready for developer consumption yet, ergo a hidden frontend-only flag.

Part of testability (rdar://problem/17732115)

Swift SVN r26292
This commit is contained in:
Jordan Rose
2015-03-19 02:20:38 +00:00
parent efd7268948
commit c6739b6b6c
9 changed files with 63 additions and 19 deletions

View File

@@ -401,6 +401,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_TESTABLE);
BLOCK(INPUT_BLOCK);
BLOCK_RECORD(input_block, IMPORTED_MODULE);
@@ -539,6 +540,11 @@ void Serializer::writeHeader(const SerializationOptions &options) {
options_block::IsSIBLayout IsSIB(Out);
IsSIB.emit(ScratchRecord, options.IsSIB);
if (M->isTestingEnabled()) {
options_block::IsTestableLayout IsTestable(Out);
IsTestable.emit(ScratchRecord);
}
if (options.SerializeOptionsForDebugging) {
options_block::SDKPathLayout SDKPath(Out);
options_block::XCCLayout XCC(Out);