From c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6 Mon Sep 17 00:00:00 2001 From: Abhina Sreeskantharajan Date: Thu, 25 Mar 2021 09:47:25 -0400 Subject: [NFC] Reordering parameters in getFile and getFileOrSTDIN In future patches I will be setting the IsText parameter frequently so I will refactor the args to be in the following order. I have removed the FileSize parameter because it is never used. ``` static ErrorOr> getFile(const Twine &Filename, bool IsText = false, bool RequiresNullTerminator = true, bool IsVolatile = false); static ErrorOr> getFileOrSTDIN(const Twine &Filename, bool IsText = false, bool RequiresNullTerminator = true); static ErrorOr> getFileAux(const Twine &Filename, uint64_t MapSize, uint64_t Offset, bool IsText, bool RequiresNullTerminator, bool IsVolatile); static ErrorOr> getFile(const Twine &Filename, bool IsVolatile = false); ``` Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D99182 --- clang/lib/Tooling/JSONCompilationDatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Tooling/JSONCompilationDatabase.cpp') diff --git a/clang/lib/Tooling/JSONCompilationDatabase.cpp b/clang/lib/Tooling/JSONCompilationDatabase.cpp index 2d8847a..97ba7e4 100644 --- a/clang/lib/Tooling/JSONCompilationDatabase.cpp +++ b/clang/lib/Tooling/JSONCompilationDatabase.cpp @@ -198,7 +198,7 @@ JSONCompilationDatabase::loadFromFile(StringRef FilePath, JSONCommandLineSyntax Syntax) { // Don't mmap: if we're a long-lived process, the build system may overwrite. llvm::ErrorOr> DatabaseBuffer = - llvm::MemoryBuffer::getFile(FilePath, /*FileSize=*/-1, + llvm::MemoryBuffer::getFile(FilePath, /*IsText=*/false, /*RequiresNullTerminator=*/true, /*IsVolatile=*/true); if (std::error_code Result = DatabaseBuffer.getError()) { -- cgit v1.1