[Driver] Pass -emit-tbd through to -frontend -merge-modules, to get TBD files without -wmo.

Fixes rdar://problem/33735706
This commit is contained in:
Huon Wilson
2018-07-02 18:27:27 +10:00
parent 9dab667544
commit 2e3e6558b7
9 changed files with 148 additions and 4 deletions

View File

@@ -769,9 +769,13 @@ static bool writeTBDIfNeeded(CompilerInvocation &Invocation,
if (!frontendOpts.InputsAndOutputs.hasTBDPath())
return false;
if (!frontendOpts.InputsAndOutputs.isWholeModule()) {
Instance.getDiags().diagnose(SourceLoc(),
diag::tbd_only_supported_in_whole_module);
return false;
}
const std::string &TBDPath = Invocation.getTBDPathForWholeModule();
assert(!TBDPath.empty() &&
"If not WMO, getTBDPathForWholeModule should have failed");
auto installName = frontendOpts.TBDInstallName.empty()
? "lib" + Invocation.getModuleName().str() + ".dylib"