void AddInteger(unsigned long long I);
void AddBoolean(bool B) { AddInteger(B ? 1U : 0U); }
void AddString(StringRef String);
+ void AddNodeID(const FoldingSetNodeID &ID);
template <typename T>
inline void Add(const T& x) { FoldingSetTrait<T>::Profile(x, *this); }
: data(a1,a2,a3,a4,a5) {}
- void Profile(FoldingSetNodeID& ID) { FoldingSetTrait<T>::Profile(data, ID); }
+ void Profile(FoldingSetNodeID &ID) { FoldingSetTrait<T>::Profile(data, ID); }
T& getValue() { return data; }
const T& getValue() const { return data; }
protected:
explicit FastFoldingSetNode(const FoldingSetNodeID &ID) : FastID(ID) {}
public:
- void Profile(FoldingSetNodeID& ID) const { ID = FastID; }
+ void Profile(FoldingSetNodeID& ID) const {
+ ID.AddNodeID(FastID);
+ }
};
//===----------------------------------------------------------------------===//
Bits.push_back(V);
}
+// AddNodeID - Adds the Bit data of another ID to *this.
+void FoldingSetNodeID::AddNodeID(const FoldingSetNodeID &ID) {
+ Bits.append(ID.Bits.begin(), ID.Bits.end());
+}
+
/// ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used to
/// lookup the node in the FoldingSetImpl.
unsigned FoldingSetNodeID::ComputeHash() const {