diff options
author | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2021-03-25 09:47:25 -0400 |
---|---|---|
committer | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2021-03-25 09:47:49 -0400 |
commit | c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6 (patch) | |
tree | d05e472da6cc9f329ec6c51095012818f6847333 /llvm/tools/llvm-cov/gcov.cpp | |
parent | 0becc4d721d0036e2e38d581bc487e27f78eb8a9 (diff) | |
download | llvm-c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6.zip llvm-c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6.tar.gz llvm-c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6.tar.bz2 |
[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<std::unique_ptr<MemoryBuffer>>
getFile(const Twine &Filename, bool IsText = false,
bool RequiresNullTerminator = true, bool IsVolatile = false);
static ErrorOr<std::unique_ptr<MemoryBuffer>>
getFileOrSTDIN(const Twine &Filename, bool IsText = false,
bool RequiresNullTerminator = true);
static ErrorOr<std::unique_ptr<MB>>
getFileAux(const Twine &Filename, uint64_t MapSize, uint64_t Offset,
bool IsText, bool RequiresNullTerminator, bool IsVolatile);
static ErrorOr<std::unique_ptr<WritableMemoryBuffer>>
getFile(const Twine &Filename, bool IsVolatile = false);
```
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D99182
Diffstat (limited to 'llvm/tools/llvm-cov/gcov.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/gcov.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/gcov.cpp b/llvm/tools/llvm-cov/gcov.cpp index d42e7cd..9a1ebeb 100644 --- a/llvm/tools/llvm-cov/gcov.cpp +++ b/llvm/tools/llvm-cov/gcov.cpp @@ -46,7 +46,8 @@ static void reportCoverage(StringRef SourceFile, StringRef ObjectDir, // Open .gcda and .gcda without requiring a NUL terminator. The concurrent // modification may nullify the NUL terminator condition. ErrorOr<std::unique_ptr<MemoryBuffer>> GCNO_Buff = - MemoryBuffer::getFileOrSTDIN(GCNO, -1, /*RequiresNullTerminator=*/false); + MemoryBuffer::getFileOrSTDIN(GCNO, /*IsText=*/false, + /*RequiresNullTerminator=*/false); if (std::error_code EC = GCNO_Buff.getError()) { errs() << GCNO << ": " << EC.message() << "\n"; return; @@ -58,7 +59,8 @@ static void reportCoverage(StringRef SourceFile, StringRef ObjectDir, } ErrorOr<std::unique_ptr<MemoryBuffer>> GCDA_Buff = - MemoryBuffer::getFileOrSTDIN(GCDA, -1, /*RequiresNullTerminator=*/false); + MemoryBuffer::getFileOrSTDIN(GCDA, /*IsText=*/false, + /*RequiresNullTerminator=*/false); if (std::error_code EC = GCDA_Buff.getError()) { if (EC != errc::no_such_file_or_directory) { errs() << GCDA << ": " << EC.message() << "\n"; |