[all-commits] [llvm/llvm-project] c83cd8: [NFC] Reordering parameters in getFile and getFile...

Abhina Sree via All-commits all-commits at lists.llvm.org
Thu Mar 25 06:48:13 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6
      https://github.com/llvm/llvm-project/commit/c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6
  Author: Abhina Sreeskantharajan <Abhina.Sreeskantharajan at ibm.com>
  Date:   2021-03-25 (Thu, 25 Mar 2021)

  Changed paths:
    M clang/lib/Tooling/JSONCompilationDatabase.cpp
    M clang/tools/arcmt-test/arcmt-test.cpp
    M lld/COFF/Driver.cpp
    M lld/COFF/DriverUtils.cpp
    M lld/ELF/InputFiles.cpp
    M lldb/source/Host/common/FileSystem.cpp
    M lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
    M lldb/unittests/TestingSupport/TestUtilities.cpp
    M llvm/include/llvm/Support/MemoryBuffer.h
    M llvm/lib/BinaryFormat/Magic.cpp
    M llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
    M llvm/lib/FuzzMutate/FuzzerCLI.cpp
    M llvm/lib/IRReader/IRReader.cpp
    M llvm/lib/LTO/LTOCodeGenerator.cpp
    M llvm/lib/Object/Binary.cpp
    M llvm/lib/ProfileData/GCOV.cpp
    M llvm/lib/Support/MemoryBuffer.cpp
    M llvm/lib/TableGen/Main.cpp
    M llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
    M llvm/tools/lli/lli.cpp
    M llvm/tools/llvm-ar/llvm-ar.cpp
    M llvm/tools/llvm-cov/gcov.cpp
    M llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
    M llvm/tools/llvm-pdbutil/InputFile.cpp
    M llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
    M llvm/tools/llvm-rc/ResourceFileWriter.cpp
    M llvm/tools/llvm-readobj/llvm-readobj.cpp
    M llvm/tools/obj2yaml/obj2yaml.cpp
    M llvm/tools/sanstats/sanstats.cpp
    M llvm/utils/FileCheck/FileCheck.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list