Skip to content

Commit cdb6738

Browse files
authored
Merge pull request #8109 from graydon/rdar-31056789-pch-driver-crash-swift-3.1-branch
[Bridging PCH] Only emit deps for CompileJobActions rdar://31056789
2 parents ed97f66 + 8754487 commit cdb6738

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/Driver/Driver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,9 @@ Job *Driver::buildJobsForAction(Compilation &C, const JobAction *JA,
20292029
if (llvm::sys::fs::is_regular_file(OutputPath))
20302030
llvm::sys::fs::remove(OutputPath);
20312031
}
2032+
}
20322033

2034+
if (isa<CompileJobAction>(JA)) {
20332035
// Choose the dependencies file output path.
20342036
if (C.getArgs().hasArg(options::OPT_emit_dependencies)) {
20352037
addAuxiliaryOutput(C, *Output, types::TY_Dependencies, OI, OutputMap);

test/Driver/bridging-pch.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
// RUN: %swiftc_driver -typecheck -disable-bridging-pch -driver-print-jobs -import-objc-header %S/Inputs/bridging-header.h %s 2>&1 | %FileCheck %s -check-prefix=NOPCHJOB
1616
// NOPCHJOB: {{.*}}swift -frontend {{.*}} -import-objc-header {{.*}}Inputs/bridging-header.h
1717

18+
// RUN: echo "{\"\": {\"swift-dependencies\": \"master.swiftdeps\"}}" > %t.json
19+
// RUN: %swiftc_driver -typecheck -incremental -enable-bridging-pch -output-file-map %t.json -import-objc-header %S/Inputs/bridging-header.h %s

0 commit comments

Comments
 (0)