]> granicus.if.org Git - llvm/commitdiff
[Coverage] Define LineColPair for convenience. NFC.
authorVedant Kumar <vsk@apple.com>
Fri, 8 Sep 2017 18:44:48 +0000 (18:44 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 8 Sep 2017 18:44:48 +0000 (18:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312815 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ProfileData/Coverage/CoverageMapping.h
lib/ProfileData/Coverage/CoverageMapping.cpp

index a315b66aafe6ffb0982603ebb7c18f2f95dcbeb1..dfcacd2cf119c0aeace4313c84a86415486b2fcd 100644 (file)
@@ -198,6 +198,8 @@ public:
   Counter subtract(Counter LHS, Counter RHS);
 };
 
+using LineColPair = std::pair<unsigned, unsigned>;
+
 /// A Counter mapping region associates a source range with a specific counter.
 struct CounterMappingRegion {
   enum RegionKind {
@@ -248,13 +250,11 @@ struct CounterMappingRegion {
                                 LineEnd, ColumnEnd, SkippedRegion);
   }
 
-  inline std::pair<unsigned, unsigned> startLoc() const {
-    return std::pair<unsigned, unsigned>(LineStart, ColumnStart);
+  inline LineColPair startLoc() const {
+    return LineColPair(LineStart, ColumnStart);
   }
 
-  inline std::pair<unsigned, unsigned> endLoc() const {
-    return std::pair<unsigned, unsigned>(LineEnd, ColumnEnd);
-  }
+  inline LineColPair endLoc() const { return LineColPair(LineEnd, ColumnEnd); }
 };
 
 /// Associates a source range with an execution count.
index d2878d3283ad87f0ce0fd6785cb880d7258126a5..e8431d700475669496aeca47b1849adfc78e241b 100644 (file)
@@ -295,8 +295,7 @@ namespace {
 /// An instantiation set is a collection of functions that have the same source
 /// code, ie, template functions specializations.
 class FunctionInstantiationSetCollector {
-  using MapT = DenseMap<std::pair<unsigned, unsigned>,
-                        std::vector<const FunctionRecord *>>;
+  using MapT = DenseMap<LineColPair, std::vector<const FunctionRecord *>>;
   MapT InstantiatedFunctions;
 
 public: