summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/SlotIndexes.h
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-27 11:29:17 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-27 11:29:17 +0000
commitedf315cd71334d5a7af31f4b882235d03b06f24d (patch)
treef374da35e77fd595c3cdf009f207852eaa9e23ac /include/llvm/CodeGen/SlotIndexes.h
parent7ccc2f7a7859a72ce73e6d8dc4242c6dd7984c45 (diff)
downloadllvm-edf315cd71334d5a7af31f4b882235d03b06f24d.tar.gz
llvm-edf315cd71334d5a7af31f4b882235d03b06f24d.tar.bz2
llvm-edf315cd71334d5a7af31f4b882235d03b06f24d.tar.xz
Provide a common half-open interval map info implementation, and just
re-use that for SlotIndexes. This way other users who want half-open semantics can share the implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SlotIndexes.h')
-rw-r--r--include/llvm/CodeGen/SlotIndexes.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h
index 4d66793e80..b46d153867 100644
--- a/include/llvm/CodeGen/SlotIndexes.h
+++ b/include/llvm/CodeGen/SlotIndexes.h
@@ -20,6 +20,7 @@
#define LLVM_CODEGEN_SLOTINDEXES_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/IntervalMap.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/ilist.h"
@@ -631,17 +632,8 @@ namespace llvm {
// Specialize IntervalMapInfo for half-open slot index intervals.
- template <typename> struct IntervalMapInfo;
- template <> struct IntervalMapInfo<SlotIndex> {
- static inline bool startLess(const SlotIndex &x, const SlotIndex &a) {
- return x < a;
- }
- static inline bool stopLess(const SlotIndex &b, const SlotIndex &x) {
- return b <= x;
- }
- static inline bool adjacent(const SlotIndex &a, const SlotIndex &b) {
- return a == b;
- }
+ template <>
+ struct IntervalMapInfo<SlotIndex> : IntervalMapHalfOpenInfo<SlotIndex> {
};
}