aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-06-08 01:52:45 +0000
committerOwen Anderson <resistor@mac.com>2007-06-08 01:52:45 +0000
commit900997ba3b832b9f0f47371ced3822d1793edc7c (patch)
treeb686334081f38121c92a85768c90496f1d9c948d /lib
parentdba2413b2ecf4e781f457036a2eb0f103192e90d (diff)
Small bugfix, and const-ify some methods (Thanks, Bill).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37513 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/GVNPRE.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp
index 2336be8901..db8e7f0634 100644
--- a/lib/Transforms/Scalar/GVNPRE.cpp
+++ b/lib/Transforms/Scalar/GVNPRE.cpp
@@ -77,8 +77,8 @@ namespace {
// Helper fuctions
// FIXME: eliminate or document these better
- void dump(std::set<Value*>& s);
- void dump_unique(std::set<Value*, ExprLT>& s);
+ void dump(const std::set<Value*>& s) const;
+ void dump_unique(const std::set<Value*, ExprLT>& s) const;
void clean(std::set<Value*, ExprLT>& set);
bool add(Value* V, uint32_t number);
Value* find_leader(std::set<Value*, ExprLT>& vals,
@@ -269,7 +269,7 @@ void GVNPRE::topo_sort(std::set<Value*, ExprLT>& set,
}
-void GVNPRE::dump(std::set<Value*>& s) {
+void GVNPRE::dump(const std::set<Value*>& s) const {
DOUT << "{ ";
for (std::set<Value*>::iterator I = s.begin(), E = s.end();
I != E; ++I) {
@@ -278,7 +278,7 @@ void GVNPRE::dump(std::set<Value*>& s) {
DOUT << "}\n\n";
}
-void GVNPRE::dump_unique(std::set<Value*, ExprLT>& s) {
+void GVNPRE::dump_unique(const std::set<Value*, ExprLT>& s) const {
DOUT << "{ ";
for (std::set<Value*>::iterator I = s.begin(), E = s.end();
I != E; ++I) {
@@ -512,8 +512,8 @@ bool GVNPRE::runOnFunction(Function &F) {
std::set<Value*, ExprLT>::iterator val = availOut.find(*I);
if (val != availOut.end())
- new_set.erase(val);
- new_set.insert(*I);
+ availOut.erase(val);
+ availOut.insert(*I);
}
}