/// GetNodeProfile - Instantiations of the FoldingSet template implement
/// this function to gather data bits for the given node.
- virtual void GetNodeProfile(FoldingSetNodeID &ID, Node *N) const = 0;
+ virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const = 0;
};
//===----------------------------------------------------------------------===//
private:
/// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
/// way to convert nodes into a unique specifier.
- virtual void GetNodeProfile(FoldingSetNodeID &ID, Node *N) const {
+ virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const {
T *TN = static_cast<T *>(N);
FoldingSetTrait<T>::Profile(*TN,ID);
}
/// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
/// way to convert nodes into a unique specifier.
- virtual void GetNodeProfile(FoldingSetNodeID &ID,
- FoldingSetImpl::Node *N) const {
+ virtual void GetNodeProfile(FoldingSetImpl::Node *N,
+ FoldingSetNodeID &ID) const {
T *TN = static_cast<T *>(N);
// We must use explicit template arguments in case Ctx is a
NodeInBucket->SetNextInBucket(0);
// Insert the node into the new bucket, after recomputing the hash.
- GetNodeProfile(ID, NodeInBucket);
+ GetNodeProfile(NodeInBucket, ID);
InsertNode(NodeInBucket, GetBucketFor(ID, Buckets, NumBuckets));
ID.clear();
}
FoldingSetNodeID OtherID;
while (Node *NodeInBucket = GetNextPtr(Probe)) {
- GetNodeProfile(OtherID, NodeInBucket);
+ GetNodeProfile(NodeInBucket, OtherID);
if (OtherID == ID)
return NodeInBucket;
if (NumNodes+1 > NumBuckets*2) {
GrowHashTable();
FoldingSetNodeID ID;
- GetNodeProfile(ID, N);
+ GetNodeProfile(N, ID);
InsertPos = GetBucketFor(ID, Buckets, NumBuckets);
}
/// instead.
FoldingSetImpl::Node *FoldingSetImpl::GetOrInsertNode(FoldingSetImpl::Node *N) {
FoldingSetNodeID ID;
- GetNodeProfile(ID, N);
+ GetNodeProfile(N, ID);
void *IP;
if (Node *E = FindNodeOrInsertPos(ID, IP))
return E;