diff options
-rw-r--r-- | llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h | 10 | ||||
-rw-r--r-- | llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h index a315b66aafe..dfcacd2cf11 100644 --- a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h +++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h @@ -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. diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp index d2878d3283a..e8431d70047 100644 --- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp +++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp @@ -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: |