[llvm] r284064 - [Coverage] Delete some copy constructors (NFC)

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 15:27:50 PDT 2016


Author: vedantk
Date: Wed Oct 12 17:27:49 2016
New Revision: 284064

URL: http://llvm.org/viewvc/llvm-project?rev=284064&view=rev
Log:
[Coverage] Delete some copy constructors (NFC)

Modified:
    llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h
    llvm/trunk/tools/llvm-cov/CoverageExporterJson.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=284064&r1=284063&r2=284064&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h (original)
+++ llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h Wed Oct 12 17:27:49 2016
@@ -290,6 +290,14 @@ struct FunctionRecord {
   FunctionRecord(StringRef Name, ArrayRef<StringRef> Filenames)
       : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {}
 
+  FunctionRecord(FunctionRecord &&FR)
+      : Name(FR.Name), Filenames(std::move(FR.Filenames)),
+        CountedRegions(std::move(FR.CountedRegions)),
+        ExecutionCount(FR.ExecutionCount) {}
+
+  FunctionRecord(const FunctionRecord &) = delete;
+  const FunctionRecord &operator=(const FunctionRecord &) = delete;
+
   void pushRegion(CounterMappingRegion Region, uint64_t Count) {
     if (CountedRegions.empty())
       ExecutionCount = Count;
@@ -425,6 +433,9 @@ class CoverageMapping {
 
   CoverageMapping() : MismatchedFunctionCount(0) {}
 
+  CoverageMapping(const CoverageMapping &) = delete;
+  const CoverageMapping &operator=(const CoverageMapping &) = delete;
+
   /// \brief Add a function record corresponding to \p Record.
   Error loadFunctionRecord(const CoverageMappingRecord &Record,
                            IndexedInstrProfReader &ProfileReader);

Modified: llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp?rev=284064&r1=284063&r2=284064&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp Wed Oct 12 17:27:49 2016
@@ -64,7 +64,7 @@ class CoverageExporterJson {
   raw_ostream &OS;
 
   /// \brief The full CoverageMapping object to export.
-  CoverageMapping Coverage;
+  const CoverageMapping &Coverage;
 
   /// \brief States that the JSON rendering machine can be in.
   enum JsonState { None, NonEmptyElement, EmptyElement };




More information about the llvm-commits mailing list