diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-09-09 18:59:51 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2023-09-13 15:02:20 -0700 |
commit | f94695b6eb0e0b2bb059c33903cc7dd4a3ddd47f (patch) | |
tree | 7e7d57821fc078d949fd66fca1ecd2d9e1771c11 /clang/lib/Basic/FileManager.cpp | |
parent | 7e013d6034bd8e81a6434f515f545b4375078512 (diff) | |
download | llvm-f94695b6eb0e0b2bb059c33903cc7dd4a3ddd47f.zip llvm-f94695b6eb0e0b2bb059c33903cc7dd4a3ddd47f.tar.gz llvm-f94695b6eb0e0b2bb059c33903cc7dd4a3ddd47f.tar.bz2 |
[clang] NFCI: Use `FileEntryRef` in `FileManager::getBufferForFile()`
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index c3eec80..30e2916 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -536,8 +536,9 @@ void FileManager::fillRealPathName(FileEntry *UFE, llvm::StringRef FileName) { } llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> -FileManager::getBufferForFile(const FileEntry *Entry, bool isVolatile, +FileManager::getBufferForFile(FileEntryRef FE, bool isVolatile, bool RequiresNullTerminator) { + const FileEntry *Entry = &FE.getFileEntry(); // If the content is living on the file entry, return a reference to it. if (Entry->Content) return llvm::MemoryBuffer::getMemBuffer(Entry->Content->getMemBufferRef()); @@ -548,7 +549,7 @@ FileManager::getBufferForFile(const FileEntry *Entry, bool isVolatile, if (isVolatile || Entry->isNamedPipe()) FileSize = -1; - StringRef Filename = Entry->getName(); + StringRef Filename = FE.getName(); // If the file is already open, use the open file descriptor. if (Entry->File) { auto Result = Entry->File->getBuffer(Filename, FileSize, |