Add some constantness.

llvm-svn: 176518
This commit is contained in:
Jakub Staszak 2013-03-05 22:01:15 +00:00
parent ab5c2012d3
commit 87c5af309c
1 changed files with 6 additions and 6 deletions

View File

@ -101,18 +101,18 @@ public:
Children.clear();
}
bool compare(DomTreeNodeBase<NodeT> *Other) {
bool compare(const DomTreeNodeBase<NodeT> *Other) const {
if (getNumChildren() != Other->getNumChildren())
return true;
SmallPtrSet<NodeT *, 4> OtherChildren;
for (iterator I = Other->begin(), E = Other->end(); I != E; ++I) {
NodeT *Nd = (*I)->getBlock();
SmallPtrSet<const NodeT *, 4> OtherChildren;
for (const_iterator I = Other->begin(), E = Other->end(); I != E; ++I) {
const NodeT *Nd = (*I)->getBlock();
OtherChildren.insert(Nd);
}
for (iterator I = begin(), E = end(); I != E; ++I) {
NodeT *N = (*I)->getBlock();
for (const_iterator I = begin(), E = end(); I != E; ++I) {
const NodeT *N = (*I)->getBlock();
if (OtherChildren.count(N) == 0)
return true;
}