Skip to content

Commit 30d298a

Browse files
committed
An attempt to reduce file accesses during the .swiftdeps file generation.
1 parent e767b74 commit 30d298a

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
@@ -492,10 +492,12 @@ static bool emitReferenceDependencies(CompilerInstance &Instance,
492492
.getLangOptions()
493493
.EmitFineGrainedDependencySourcefileDotFiles;
494494

495+
#ifndef NDEBUG
495496
// Before writing to the dependencies file path, preserve any previous file
496497
// that may have been there. No error handling -- this is just a nicety, it
497498
// doesn't matter if it fails.
498499
llvm::sys::fs::rename(outputPath, outputPath + "~");
500+
#endif
499501

500502
using SourceFileDepGraph = fine_grained_dependencies::SourceFileDepGraph;
501503
return fine_grained_dependencies::withReferenceDependencies(
@@ -507,7 +509,7 @@ static bool emitReferenceDependencies(CompilerInstance &Instance,
507509
g);
508510

509511
// If path is stdout, cannot read it back, so check for "-"
510-
assert(outputPath == "-" || g.verifyReadsWhatIsWritten(outputPath));
512+
DEBUG_ASSERT(outputPath == "-" || g.verifyReadsWhatIsWritten(outputPath));
511513

512514
if (alsoEmitDotFile)
513515
g.emitDotFile(Instance.getOutputBackend(), outputPath,

0 commit comments

Comments
 (0)