From 87c5af309c6a1e9535d825d01863030c56f2efaf Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Tue, 5 Mar 2013 22:01:15 +0000 Subject: [PATCH] Add some constantness. llvm-svn: 176518 --- llvm/include/llvm/Analysis/Dominators.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/llvm/include/llvm/Analysis/Dominators.h b/llvm/include/llvm/Analysis/Dominators.h index b4cdbbc20e2b..81c04bb6b0fa 100644 --- a/llvm/include/llvm/Analysis/Dominators.h +++ b/llvm/include/llvm/Analysis/Dominators.h @@ -101,18 +101,18 @@ public: Children.clear(); } - bool compare(DomTreeNodeBase *Other) { + bool compare(const DomTreeNodeBase *Other) const { if (getNumChildren() != Other->getNumChildren()) return true; - SmallPtrSet OtherChildren; - for (iterator I = Other->begin(), E = Other->end(); I != E; ++I) { - NodeT *Nd = (*I)->getBlock(); + SmallPtrSet 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; }