If type-checking in batch mode with no errors, don’t crash on outputting unneeded ObjCHeader.

This commit is contained in:
David Ungar
2018-05-09 19:19:04 -07:00
parent 4f003b41de
commit 4a194a924b

View File

@@ -948,9 +948,13 @@ static bool performCompile(CompilerInstance &Instance,
// We've just been told to perform a typecheck, so we can return now.
if (Action == FrontendOptions::ActionType::Typecheck) {
const bool hadPrintAsObjCError = printAsObjCIfNeeded(
Invocation.getObjCHeaderOutputPathForAtMostOnePrimary(),
Instance.getMainModule(), opts.ImplicitObjCHeaderPath, moduleIsPublic);
const bool hadPrintAsObjCError =
Invocation.getFrontendOptions()
.InputsAndOutputs.hasObjCHeaderOutputPath() &&
printAsObjCIfNeeded(
Invocation.getObjCHeaderOutputPathForAtMostOnePrimary(),
Instance.getMainModule(), opts.ImplicitObjCHeaderPath,
moduleIsPublic);
const bool hadEmitIndexDataError = emitIndexData(Invocation, Instance);