aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r--llvm/lib/Support/VirtualFileSystem.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index ceca65b..928c0b5 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -117,9 +117,8 @@ FileSystem::~FileSystem() = default;
ErrorOr<std::unique_ptr<MemoryBuffer>>
FileSystem::getBufferForFile(const llvm::Twine &Name, int64_t FileSize,
- bool RequiresNullTerminator, bool IsVolatile,
- bool IsText) {
- auto F = openFileForRead(Name, IsText);
+ bool RequiresNullTerminator, bool IsVolatile) {
+ auto F = openFileForRead(Name);
if (!F)
return F.getError();
@@ -279,8 +278,7 @@ public:
}
ErrorOr<Status> status(const Twine &Path) override;
- ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path,
- bool IsText = true) override;
+ ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path) override;
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override;
llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const override;
@@ -325,11 +323,10 @@ ErrorOr<Status> RealFileSystem::status(const Twine &Path) {
}
ErrorOr<std::unique_ptr<File>>
-RealFileSystem::openFileForRead(const Twine &Name, bool IsText) {
+RealFileSystem::openFileForRead(const Twine &Name) {
SmallString<256> RealName, Storage;
Expected<file_t> FDOrErr = sys::fs::openNativeFileForRead(
- adjustPath(Name, Storage), IsText ? sys::fs::OF_Text : sys::fs::OF_None,
- &RealName);
+ adjustPath(Name, Storage), sys::fs::OF_None, &RealName);
if (!FDOrErr)
return errorToErrorCode(FDOrErr.takeError());
return std::unique_ptr<File>(
@@ -461,10 +458,10 @@ bool OverlayFileSystem::exists(const Twine &Path) {
}
ErrorOr<std::unique_ptr<File>>
-OverlayFileSystem::openFileForRead(const llvm::Twine &Path, bool IsText) {
+OverlayFileSystem::openFileForRead(const llvm::Twine &Path) {
// FIXME: handle symlinks that cross file systems
for (iterator I = overlays_begin(), E = overlays_end(); I != E; ++I) {
- auto Result = (*I)->openFileForRead(Path, IsText);
+ auto Result = (*I)->openFileForRead(Path);
if (Result || Result.getError() != llvm::errc::no_such_file_or_directory)
return Result;
}
@@ -1076,7 +1073,7 @@ llvm::ErrorOr<Status> InMemoryFileSystem::status(const Twine &Path) {
}
llvm::ErrorOr<std::unique_ptr<File>>
-InMemoryFileSystem::openFileForRead(const Twine &Path, bool IsText) {
+InMemoryFileSystem::openFileForRead(const Twine &Path) {
auto Node = lookupNode(Path,/*FollowFinalSymlink=*/true);
if (!Node)
return Node.getError();
@@ -2540,7 +2537,7 @@ File::getWithPath(ErrorOr<std::unique_ptr<File>> Result, const Twine &P) {
}
ErrorOr<std::unique_ptr<File>>
-RedirectingFileSystem::openFileForRead(const Twine &OriginalPath, bool IsText) {
+RedirectingFileSystem::openFileForRead(const Twine &OriginalPath) {
SmallString<256> Path;
OriginalPath.toVector(Path);