Skip to content

Commit a5e6a7f

Browse files
authored
Merge pull request #78793 from hjyamauchi/emit-reference-dependencies
An attempt to reduce file accesses during the .swiftdeps file generat…
2 parents 36af875 + 30d298a commit a5e6a7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,12 @@ static bool emitReferenceDependencies(CompilerInstance &Instance,
522522
.getLangOptions()
523523
.EmitFineGrainedDependencySourcefileDotFiles;
524524

525+
#ifndef NDEBUG
525526
// Before writing to the dependencies file path, preserve any previous file
526527
// that may have been there. No error handling -- this is just a nicety, it
527528
// doesn't matter if it fails.
528529
llvm::sys::fs::rename(outputPath, outputPath + "~");
530+
#endif
529531

530532
using SourceFileDepGraph = fine_grained_dependencies::SourceFileDepGraph;
531533
return fine_grained_dependencies::withReferenceDependencies(
@@ -537,7 +539,7 @@ static bool emitReferenceDependencies(CompilerInstance &Instance,
537539
g);
538540

539541
// If path is stdout, cannot read it back, so check for "-"
540-
assert(outputPath == "-" || g.verifyReadsWhatIsWritten(outputPath));
542+
DEBUG_ASSERT(outputPath == "-" || g.verifyReadsWhatIsWritten(outputPath));
541543

542544
if (alsoEmitDotFile)
543545
g.emitDotFile(Instance.getOutputBackend(), outputPath,

0 commit comments

Comments
 (0)