Skip to content

Commit cc83751

Browse files
author
David Ungar
committed
Avoid need to check errors on dummy file creation.
1 parent ecb74b5 commit cc83751

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "llvm/Support/Process.h"
3535
#include "llvm/Support/Program.h"
3636

37+
#include <fstream>
38+
3739
using namespace swift;
3840
using namespace swift::driver;
3941
using namespace llvm::opt;
@@ -679,10 +681,7 @@ void ToolChain::JobContext::addFrontendSupplementaryOutputArguments(
679681
},
680682
[&](StringRef dependencyFile) {
681683
// Create an empty file
682-
using namespace llvm::sys::fs;
683-
if (auto file = openNativeFileForWrite(dependencyFile, CD_CreateAlways,
684-
OF_Text))
685-
closeFile(file.get());
684+
std::ofstream(dependencyFile.str().c_str());
686685
});
687686

688687
addOutputsOfType(arguments, Output, Args, file_types::TY_SwiftDeps,

0 commit comments

Comments
 (0)