[llvm] r306776 - [Coverage] Remove two overloads of CoverageMapping::load. NFC.

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 17:45:26 PDT 2017


Author: vedantk
Date: Thu Jun 29 17:45:26 2017
New Revision: 306776

URL: http://llvm.org/viewvc/llvm-project?rev=306776&view=rev
Log:
[Coverage] Remove two overloads of CoverageMapping::load. NFC.

These overloads are essentially dead, and pose a maintenance cost
without adding any benefit. This is coming up now because I'd like to
experiment with changing the way we store coverage mapping data, and
would rather not have to fix up the old overloads while doing so.

Testing: check-{llvm,profile}, build clang.

Modified:
    llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h
    llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp
    llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp

Modified: llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h?rev=306776&r1=306775&r2=306776&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h (original)
+++ llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h Thu Jun 29 17:45:26 2017
@@ -451,20 +451,9 @@ public:
 
   /// \brief Load the coverage mapping using the given readers.
   static Expected<std::unique_ptr<CoverageMapping>>
-  load(CoverageMappingReader &CoverageReader,
-       IndexedInstrProfReader &ProfileReader);
-
-  static Expected<std::unique_ptr<CoverageMapping>>
   load(ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
        IndexedInstrProfReader &ProfileReader);
 
-  /// \brief Load the coverage mapping from the given files.
-  static Expected<std::unique_ptr<CoverageMapping>>
-  load(StringRef ObjectFilename, StringRef ProfileFilename,
-       StringRef Arch = StringRef()) {
-    return load(ArrayRef<StringRef>(ObjectFilename), ProfileFilename, Arch);
-  }
-
   static Expected<std::unique_ptr<CoverageMapping>>
   load(ArrayRef<StringRef> ObjectFilenames, StringRef ProfileFilename,
        StringRef Arch = StringRef());

Modified: llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp?rev=306776&r1=306775&r2=306776&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp (original)
+++ llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp Thu Jun 29 17:45:26 2017
@@ -245,18 +245,6 @@ Error CoverageMapping::loadFunctionRecor
   return Error::success();
 }
 
-Expected<std::unique_ptr<CoverageMapping>>
-CoverageMapping::load(CoverageMappingReader &CoverageReader,
-                      IndexedInstrProfReader &ProfileReader) {
-  auto Coverage = std::unique_ptr<CoverageMapping>(new CoverageMapping());
-
-  for (const auto &Record : CoverageReader)
-    if (Error E = Coverage->loadFunctionRecord(Record, ProfileReader))
-      return std::move(E);
-
-  return std::move(Coverage);
-}
-
 Expected<std::unique_ptr<CoverageMapping>> CoverageMapping::load(
     ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
     IndexedInstrProfReader &ProfileReader) {

Modified: llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp?rev=306776&r1=306775&r2=306776&view=diff
==============================================================================
--- llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp (original)
+++ llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp Thu Jun 29 17:45:26 2017
@@ -232,15 +232,16 @@ struct CoverageMappingTest : ::testing::
   }
 
   Expected<std::unique_ptr<CoverageMapping>> readOutputFunctions() {
-    if (!UseMultipleReaders) {
-      CoverageMappingReaderMock CovReader(OutputFunctions);
-      return CoverageMapping::load(CovReader, *ProfileReader);
-    }
-
     std::vector<std::unique_ptr<CoverageMappingReader>> CoverageReaders;
-    for (const auto &OF : OutputFunctions) {
-      ArrayRef<OutputFunctionCoverageData> Funcs(OF);
-      CoverageReaders.push_back(make_unique<CoverageMappingReaderMock>(Funcs));
+    if (UseMultipleReaders) {
+      for (const auto &OF : OutputFunctions) {
+        ArrayRef<OutputFunctionCoverageData> Funcs(OF);
+        CoverageReaders.push_back(
+            make_unique<CoverageMappingReaderMock>(Funcs));
+      }
+    } else {
+      CoverageReaders.push_back(
+          make_unique<CoverageMappingReaderMock>(OutputFunctions));
     }
     return CoverageMapping::load(CoverageReaders, *ProfileReader);
   }




More information about the llvm-commits mailing list