[llvm] r275337 - [Coverage] Mark a few methods const (NFC)

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 16:12:24 PDT 2016


Author: vedantk
Date: Wed Jul 13 18:12:23 2016
New Revision: 275337

URL: http://llvm.org/viewvc/llvm-project?rev=275337&view=rev
Log:
[Coverage] Mark a few methods const (NFC)

Modified:
    llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h
    llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.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=275337&r1=275336&r2=275337&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h (original)
+++ llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h Wed Jul 13 18:12:23 2016
@@ -416,7 +416,7 @@ public:
         Expansions(std::move(RHS.Expansions)) {}
 
   /// \brief Get the name of the file this data covers.
-  StringRef getFilename() { return Filename; }
+  StringRef getFilename() const { return Filename; }
 
   std::vector<CoverageSegment>::iterator begin() { return Segments.begin(); }
   std::vector<CoverageSegment>::iterator end() { return Segments.end(); }
@@ -461,7 +461,7 @@ public:
   /// The given filename must be the name as recorded in the coverage
   /// information. That is, only names returned from getUniqueSourceFiles will
   /// yield a result.
-  CoverageData getCoverageForFile(StringRef Filename);
+  CoverageData getCoverageForFile(StringRef Filename) const;
 
   /// \brief Gets all of the functions covered by this profile.
   iterator_range<FunctionRecordIterator> getCoveredFunctions() const {

Modified: llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp?rev=275337&r1=275336&r2=275337&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp (original)
+++ llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp Wed Jul 13 18:12:23 2016
@@ -456,7 +456,7 @@ static bool isExpansion(const CountedReg
   return R.Kind == CounterMappingRegion::ExpansionRegion && R.FileID == FileID;
 }
 
-CoverageData CoverageMapping::getCoverageForFile(StringRef Filename) {
+CoverageData CoverageMapping::getCoverageForFile(StringRef Filename) const {
   CoverageData FileCoverage(Filename);
   std::vector<coverage::CountedRegion> Regions;
 




More information about the llvm-commits mailing list