r228076 - InstrProf: Update for LLVM API change

Justin Bogner mail at justinbogner.com
Tue Feb 3 15:59:48 PST 2015


Author: bogner
Date: Tue Feb  3 17:59:48 2015
New Revision: 228076

URL: http://llvm.org/viewvc/llvm-project?rev=228076&view=rev
Log:
InstrProf: Update for LLVM API change

Update for the API change in r228075

Modified:
    cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp

Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp?rev=228076&r1=228075&r2=228076&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp (original)
+++ cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp Tue Feb  3 17:59:48 2015
@@ -246,9 +246,8 @@ public:
       unsigned ColumnStart = SM.getSpellingColumnNumber(LocStart);
       unsigned LineEnd = SM.getSpellingLineNumber(LocEnd);
       unsigned ColumnEnd = SM.getSpellingColumnNumber(LocEnd);
-      CounterMappingRegion Region(Counter(), *CovFileID, LineStart, ColumnStart,
-                                  LineEnd, ColumnEnd,
-                                  CounterMappingRegion::SkippedRegion);
+      auto Region = CounterMappingRegion::makeSkipped(
+          *CovFileID, LineStart, ColumnStart, LineEnd, ColumnEnd);
       // Make sure that we only collect the regions that are inside
       // the souce code of this function.
       if (Region.LineStart >= FileLineRanges[*CovFileID].first &&
@@ -284,10 +283,9 @@ public:
         ColumnStart +
         Lexer::MeasureTokenLength(SM.getSpellingLoc(LocStart), SM, LangOpts);
 
-    MappingRegions.push_back(CounterMappingRegion(
-        Counter(), *CovFileID, LineStart, ColumnStart, LineEnd, ColumnEnd,
-        CounterMappingRegion::ExpansionRegion));
-    MappingRegions.back().ExpandedFileID = *ExpandedFileID;
+    MappingRegions.push_back(CounterMappingRegion::makeExpansion(
+        *CovFileID, *ExpandedFileID, LineStart, ColumnStart, LineEnd,
+        ColumnEnd));
   }
 
   /// \brief Enter a source region group that is identified by the given
@@ -375,9 +373,9 @@ public:
         continue;
 
       assert(LineStart <= LineEnd);
-      MappingRegions.push_back(CounterMappingRegion(
+      MappingRegions.push_back(CounterMappingRegion::makeRegion(
           I->getCounter(), *CovFileID, LineStart, ColumnStart, LineEnd,
-          ColumnEnd, CounterMappingRegion::CodeRegion));
+          ColumnEnd));
     }
   }
 };





More information about the cfe-commits mailing list