summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-09-08 18:44:48 +0000
committerVedant Kumar <vsk@apple.com>2017-09-08 18:44:48 +0000
commitefcf41b528232d81dd62dc3a1585532c75549ccc (patch)
tree68eaa61104c48ee11c82c7858c23549c333e3b57 /llvm
parentbae8397006fcb479bc9bcfe84e826bacbfbe7891 (diff)
downloadbcm5719-llvm-efcf41b528232d81dd62dc3a1585532c75549ccc.tar.gz
bcm5719-llvm-efcf41b528232d81dd62dc3a1585532c75549ccc.zip
[Coverage] Define LineColPair for convenience. NFC.
llvm-svn: 312815
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h10
-rw-r--r--llvm/lib/ProfileData/Coverage/CoverageMapping.cpp3
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:
OpenPOWER on IntegriCloud