[llvm-commits] [llvm] r111127 - in /llvm/trunk: include/llvm/ADT/FoldingSet.h lib/Support/FoldingSet.cpp
Dan Gohman
gohman at apple.com
Mon Aug 16 07:53:42 PDT 2010
Author: djg
Date: Mon Aug 16 09:53:42 2010
New Revision: 111127
URL: http://llvm.org/viewvc/llvm-project?rev=111127&view=rev
Log:
Reverse the order of GetNodeProfile's arguments, for consistency
with FoldingSetTrait::Profile.
Modified:
llvm/trunk/include/llvm/ADT/FoldingSet.h
llvm/trunk/lib/Support/FoldingSet.cpp
Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=111127&r1=111126&r2=111127&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/FoldingSet.h (original)
+++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Aug 16 09:53:42 2010
@@ -190,7 +190,7 @@
/// 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 @@
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 @@
/// 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
Modified: llvm/trunk/lib/Support/FoldingSet.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FoldingSet.cpp?rev=111127&r1=111126&r2=111127&view=diff
==============================================================================
--- llvm/trunk/lib/Support/FoldingSet.cpp (original)
+++ llvm/trunk/lib/Support/FoldingSet.cpp Mon Aug 16 09:53:42 2010
@@ -229,7 +229,7 @@
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 @@
FoldingSetNodeID OtherID;
while (Node *NodeInBucket = GetNextPtr(Probe)) {
- GetNodeProfile(OtherID, NodeInBucket);
+ GetNodeProfile(NodeInBucket, OtherID);
if (OtherID == ID)
return NodeInBucket;
@@ -274,7 +274,7 @@
if (NumNodes+1 > NumBuckets*2) {
GrowHashTable();
FoldingSetNodeID ID;
- GetNodeProfile(ID, N);
+ GetNodeProfile(N, ID);
InsertPos = GetBucketFor(ID, Buckets, NumBuckets);
}
@@ -341,7 +341,7 @@
/// 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;
More information about the llvm-commits
mailing list