summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commit2e5efc30c27c4fbdf72a4a7a9c9ae1630fcc625d (patch)
tree85b484bac11f45091f337ea950daa6764001f453 /llvm/lib/Transforms
parentbecc466451f3aded756009b93e2f3a965ad70e4d (diff)
downloadbcm5719-llvm-2e5efc30c27c4fbdf72a4a7a9c9ae1630fcc625d.tar.gz
bcm5719-llvm-2e5efc30c27c4fbdf72a4a7a9c9ae1630fcc625d.zip
Small bugfix, and const-ify some methods (Thanks, Bill).
llvm-svn: 37513
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/GVNPRE.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVNPRE.cpp b/llvm/lib/Transforms/Scalar/GVNPRE.cpp
index 2336be8901c..db8e7f0634f 100644
--- a/llvm/lib/Transforms/Scalar/GVNPRE.cpp
+++ b/llvm/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);
}
}
OpenPOWER on IntegriCloud