Skip to content

Commit

Permalink
Adding sys::fs::convertFDToNativeFile(FD), to address llvm.org/D63452
Browse files Browse the repository at this point in the history
IndexUnitReader.cpp is not in upstream llvm. It was using an older API.

apple-llvm-split-commit: 22e736d26defec479b7fcd0fdbbe42ad0ac4ae10
apple-llvm-split-dir: clang/
  • Loading branch information
plotfi committed Jul 12, 2019
1 parent fc347b5 commit 1d3f2b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang/lib/Index/IndexUnitReader.cpp
Expand Up @@ -425,7 +425,8 @@ IndexUnitReader::createWithFilePath(StringRef FilePath, std::string &Error) {
return nullptr;
}

auto ErrOrBuf = MemoryBuffer::getOpenFile(FD, FilePath, /*FileSize=*/-1,
auto ErrOrBuf = MemoryBuffer::getOpenFile(sys::fs::convertFDToNativeFile(FD),
FilePath, /*FileSize=*/-1,
/*RequiresNullTerminator=*/false);
if (!ErrOrBuf) {
raw_string_ostream(Error) << "Failed opening '" << FilePath << "': "
Expand Down

0 comments on commit 1d3f2b7

Please sign in to comment.