Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,
LiveInterval>. This saves some space and removes the pointer
indirection caused by following the pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15167 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LiveInterval.h b/lib/CodeGen/LiveInterval.h
index 75acf52..dde7a86 100644
--- a/lib/CodeGen/LiveInterval.h
+++ b/lib/CodeGen/LiveInterval.h
@@ -76,6 +76,21 @@
: reg(Reg), weight(Weight), NumValues(0) {
}
+ LiveInterval& operator=(const LiveInterval& rhs) {
+ reg = rhs.reg;
+ weight = rhs.weight;
+ ranges = rhs.ranges;
+ NumValues = rhs.NumValues;
+ return *this;
+ }
+
+ void swap(LiveInterval& other) {
+ std::swap(reg, other.reg);
+ std::swap(weight, other.weight);
+ ranges.swap(other.ranges);
+ std::swap(NumValues, other.NumValues);
+ }
+
bool containsOneValue() const { return NumValues == 1; }
unsigned getNextValue() {