mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-13 20:25:12 +00:00
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
This commit is contained in:
@ -77,8 +77,8 @@ namespace {
|
|||||||
|
|
||||||
// Helper fuctions
|
// Helper fuctions
|
||||||
// FIXME: eliminate or document these better
|
// FIXME: eliminate or document these better
|
||||||
void dump(std::set<Value*>& s);
|
void dump(const std::set<Value*>& s) const;
|
||||||
void dump_unique(std::set<Value*, ExprLT>& s);
|
void dump_unique(const std::set<Value*, ExprLT>& s) const;
|
||||||
void clean(std::set<Value*, ExprLT>& set);
|
void clean(std::set<Value*, ExprLT>& set);
|
||||||
bool add(Value* V, uint32_t number);
|
bool add(Value* V, uint32_t number);
|
||||||
Value* find_leader(std::set<Value*, ExprLT>& vals,
|
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 << "{ ";
|
DOUT << "{ ";
|
||||||
for (std::set<Value*>::iterator I = s.begin(), E = s.end();
|
for (std::set<Value*>::iterator I = s.begin(), E = s.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
@ -278,7 +278,7 @@ void GVNPRE::dump(std::set<Value*>& s) {
|
|||||||
DOUT << "}\n\n";
|
DOUT << "}\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void GVNPRE::dump_unique(std::set<Value*, ExprLT>& s) {
|
void GVNPRE::dump_unique(const std::set<Value*, ExprLT>& s) const {
|
||||||
DOUT << "{ ";
|
DOUT << "{ ";
|
||||||
for (std::set<Value*>::iterator I = s.begin(), E = s.end();
|
for (std::set<Value*>::iterator I = s.begin(), E = s.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
@ -512,8 +512,8 @@ bool GVNPRE::runOnFunction(Function &F) {
|
|||||||
|
|
||||||
std::set<Value*, ExprLT>::iterator val = availOut.find(*I);
|
std::set<Value*, ExprLT>::iterator val = availOut.find(*I);
|
||||||
if (val != availOut.end())
|
if (val != availOut.end())
|
||||||
new_set.erase(val);
|
availOut.erase(val);
|
||||||
new_set.insert(*I);
|
availOut.insert(*I);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user