mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add flag to verify just-emitted module interfaces
The driver can now schedule jobs which typecheck just-emitted module interfaces to ensure that they can be consumed later. This can be enabled manually by passing `-verify-emitted-module-interface` to the driver.
This commit is contained in:
@@ -2208,6 +2208,26 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
|
||||
TopLevelActions.push_back(MergeModuleAction);
|
||||
TopLevelActions.append(AllLinkerInputs.begin(), AllLinkerInputs.end());
|
||||
}
|
||||
|
||||
bool verifyInterfacesByDefault = false;
|
||||
|
||||
if (MergeModuleAction
|
||||
&& Args.hasFlag(options::OPT_verify_emitted_module_interface,
|
||||
options::OPT_no_verify_emitted_module_interface,
|
||||
verifyInterfacesByDefault)) {
|
||||
if (Args.hasArgNoClaim(options::OPT_emit_module_interface,
|
||||
options::OPT_emit_module_interface_path)) {
|
||||
TopLevelActions.push_back(
|
||||
C.createAction<VerifyModuleInterfaceJobAction>(MergeModuleAction,
|
||||
file_types::TY_SwiftModuleInterfaceFile));
|
||||
}
|
||||
|
||||
if (Args.hasArgNoClaim(options::OPT_emit_private_module_interface_path)) {
|
||||
TopLevelActions.push_back(
|
||||
C.createAction<VerifyModuleInterfaceJobAction>(MergeModuleAction,
|
||||
file_types::TY_PrivateSwiftModuleInterfaceFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Driver::handleImmediateArgs(const ArgList &Args, const ToolChain &TC) {
|
||||
|
||||
Reference in New Issue
Block a user