mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Reverse the order of GetNodeProfile's arguments, for consistency
with FoldingSetTrait::Profile. llvm-svn: 111127
This commit is contained in:
parent
8ba122de76
commit
4446294688
@ -190,7 +190,7 @@ protected:
|
|||||||
|
|
||||||
/// GetNodeProfile - Instantiations of the FoldingSet template implement
|
/// GetNodeProfile - Instantiations of the FoldingSet template implement
|
||||||
/// this function to gather data bits for the given node.
|
/// 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:
|
private:
|
||||||
/// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
|
/// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
|
||||||
/// way to convert nodes into a unique specifier.
|
/// 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);
|
T *TN = static_cast<T *>(N);
|
||||||
FoldingSetTrait<T>::Profile(*TN,ID);
|
FoldingSetTrait<T>::Profile(*TN,ID);
|
||||||
}
|
}
|
||||||
@ -354,8 +354,8 @@ private:
|
|||||||
|
|
||||||
/// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
|
/// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
|
||||||
/// way to convert nodes into a unique specifier.
|
/// way to convert nodes into a unique specifier.
|
||||||
virtual void GetNodeProfile(FoldingSetNodeID &ID,
|
virtual void GetNodeProfile(FoldingSetImpl::Node *N,
|
||||||
FoldingSetImpl::Node *N) const {
|
FoldingSetNodeID &ID) const {
|
||||||
T *TN = static_cast<T *>(N);
|
T *TN = static_cast<T *>(N);
|
||||||
|
|
||||||
// We must use explicit template arguments in case Ctx is a
|
// We must use explicit template arguments in case Ctx is a
|
||||||
|
@ -229,7 +229,7 @@ void FoldingSetImpl::GrowHashTable() {
|
|||||||
NodeInBucket->SetNextInBucket(0);
|
NodeInBucket->SetNextInBucket(0);
|
||||||
|
|
||||||
// Insert the node into the new bucket, after recomputing the hash.
|
// Insert the node into the new bucket, after recomputing the hash.
|
||||||
GetNodeProfile(ID, NodeInBucket);
|
GetNodeProfile(NodeInBucket, ID);
|
||||||
InsertNode(NodeInBucket, GetBucketFor(ID, Buckets, NumBuckets));
|
InsertNode(NodeInBucket, GetBucketFor(ID, Buckets, NumBuckets));
|
||||||
ID.clear();
|
ID.clear();
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ FoldingSetImpl::Node
|
|||||||
|
|
||||||
FoldingSetNodeID OtherID;
|
FoldingSetNodeID OtherID;
|
||||||
while (Node *NodeInBucket = GetNextPtr(Probe)) {
|
while (Node *NodeInBucket = GetNextPtr(Probe)) {
|
||||||
GetNodeProfile(OtherID, NodeInBucket);
|
GetNodeProfile(NodeInBucket, OtherID);
|
||||||
if (OtherID == ID)
|
if (OtherID == ID)
|
||||||
return NodeInBucket;
|
return NodeInBucket;
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) {
|
|||||||
if (NumNodes+1 > NumBuckets*2) {
|
if (NumNodes+1 > NumBuckets*2) {
|
||||||
GrowHashTable();
|
GrowHashTable();
|
||||||
FoldingSetNodeID ID;
|
FoldingSetNodeID ID;
|
||||||
GetNodeProfile(ID, N);
|
GetNodeProfile(N, ID);
|
||||||
InsertPos = GetBucketFor(ID, Buckets, NumBuckets);
|
InsertPos = GetBucketFor(ID, Buckets, NumBuckets);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ bool FoldingSetImpl::RemoveNode(Node *N) {
|
|||||||
/// instead.
|
/// instead.
|
||||||
FoldingSetImpl::Node *FoldingSetImpl::GetOrInsertNode(FoldingSetImpl::Node *N) {
|
FoldingSetImpl::Node *FoldingSetImpl::GetOrInsertNode(FoldingSetImpl::Node *N) {
|
||||||
FoldingSetNodeID ID;
|
FoldingSetNodeID ID;
|
||||||
GetNodeProfile(ID, N);
|
GetNodeProfile(N, ID);
|
||||||
void *IP;
|
void *IP;
|
||||||
if (Node *E = FindNodeOrInsertPos(ID, IP))
|
if (Node *E = FindNodeOrInsertPos(ID, IP))
|
||||||
return E;
|
return E;
|
||||||
|
Loading…
Reference in New Issue
Block a user