[master-next] More changes to adapt to new LLVM flags in r334221

My previous change for this issue (033b884de6) did not fix all the
affected code. This gets the rest of them. Thanks for Jason Molenda
for helping with this. rdar://problem/41025365
This commit is contained in:
Bob Wilson
2018-06-12 14:47:03 -07:00
parent 033b884de6
commit e1cbc560f9
2 changed files with 5 additions and 3 deletions

View File

@@ -212,7 +212,8 @@ static bool emitLoadedModuleTraceIfNeeded(ASTContext &ctxt,
StringRef realPath;
int FD;
// FIXME: appropriate error handling
if (llvm::sys::fs::openFileForRead(dep, FD, &buffer)) {
if (llvm::sys::fs::openFileForRead(dep, FD, llvm::sys::fs::OF_None,
&buffer)) {
// Couldn't open the file now, so let's just assume the old path was
// canonical (enough).
realPath = dep;
@@ -1440,7 +1441,7 @@ static bool dumpAPI(ModuleDecl *Mod, StringRef OutDir) {
}
std::error_code EC;
llvm::raw_fd_ostream OS(OutPath, EC, fs::OpenFlags::F_RW);
llvm::raw_fd_ostream OS(OutPath, EC, fs::FA_Read | fs::FA_Write);
if (EC) {
llvm::errs() << "error opening file '" << OutPath << "': "
<< EC.message() << '\n';