Skip to content

Commit 4a194a9

Browse files
author
David Ungar
committed
If type-checking in batch mode with no errors, don’t crash on outputting unneeded ObjCHeader.
1 parent 4f003b4 commit 4a194a9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,9 +948,13 @@ static bool performCompile(CompilerInstance &Instance,
948948

949949
// We've just been told to perform a typecheck, so we can return now.
950950
if (Action == FrontendOptions::ActionType::Typecheck) {
951-
const bool hadPrintAsObjCError = printAsObjCIfNeeded(
952-
Invocation.getObjCHeaderOutputPathForAtMostOnePrimary(),
953-
Instance.getMainModule(), opts.ImplicitObjCHeaderPath, moduleIsPublic);
951+
const bool hadPrintAsObjCError =
952+
Invocation.getFrontendOptions()
953+
.InputsAndOutputs.hasObjCHeaderOutputPath() &&
954+
printAsObjCIfNeeded(
955+
Invocation.getObjCHeaderOutputPathForAtMostOnePrimary(),
956+
Instance.getMainModule(), opts.ImplicitObjCHeaderPath,
957+
moduleIsPublic);
954958

955959
const bool hadEmitIndexDataError = emitIndexData(Invocation, Instance);
956960

0 commit comments

Comments
 (0)