diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-16 14:53:42 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-16 14:53:42 +0000 |
commit | 6616f7e2f147c2320973993cbfb241a82262b764 (patch) | |
tree | 8f13bc3daa9eda59f0c97da2be05b72c447aa6ad | |
parent | 83fb63d5b3669aec8925af23907ca2b404a51f74 (diff) |
Reverse the order of GetNodeProfile's arguments, for consistency
with FoldingSetTrait::Profile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111127 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/FoldingSet.h | 8 | ||||
-rw-r--r-- | lib/Support/FoldingSet.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/llvm/ADT/FoldingSet.h b/include/llvm/ADT/FoldingSet.h index 72f921395c..0a7401dad0 100644 --- a/include/llvm/ADT/FoldingSet.h +++ b/include/llvm/ADT/FoldingSet.h @@ -190,7 +190,7 @@ protected: /// 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; }; //===----------------------------------------------------------------------===// @@ -290,7 +290,7 @@ template<class T> class FoldingSet : public FoldingSetImpl { 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); } @@ -354,8 +354,8 @@ private: /// 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 diff --git a/lib/Support/FoldingSet.cpp b/lib/Support/FoldingSet.cpp index b8dca334da..c1b6511a93 100644 --- a/lib/Support/FoldingSet.cpp +++ b/lib/Support/FoldingSet.cpp @@ -229,7 +229,7 @@ void FoldingSetImpl::GrowHashTable() { 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(); } @@ -252,7 +252,7 @@ FoldingSetImpl::Node FoldingSetNodeID OtherID; while (Node *NodeInBucket = GetNextPtr(Probe)) { - GetNodeProfile(OtherID, NodeInBucket); + GetNodeProfile(NodeInBucket, OtherID); if (OtherID == ID) return NodeInBucket; @@ -274,7 +274,7 @@ void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) { if (NumNodes+1 > NumBuckets*2) { GrowHashTable(); FoldingSetNodeID ID; - GetNodeProfile(ID, N); + GetNodeProfile(N, ID); InsertPos = GetBucketFor(ID, Buckets, NumBuckets); } @@ -341,7 +341,7 @@ bool FoldingSetImpl::RemoveNode(Node *N) { /// 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; |