mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-13 15:37:24 +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:
parent
dba2413b2e
commit
900997ba3b
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user