[llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Jun 8 13:55:22 PDT 2004
Changes in directory reopt/lib/TraceToFunction:
TraceToFunction.cpp updated: 1.60 -> 1.61
---
Log message:
Fix up O2CMap correctly if we replace a value with a constant in fixupPhis().
---
Diffs of the changes: (+6 -1)
Index: reopt/lib/TraceToFunction/TraceToFunction.cpp
diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.60 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.61
--- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.60 Fri Jun 4 12:58:25 2004
+++ reopt/lib/TraceToFunction/TraceToFunction.cpp Tue Jun 8 13:54:00 2004
@@ -388,7 +388,12 @@
assert (i->first->use_size () == 0
&& "Whoops, I was going to delete something which still has uses");
dstB->getInstList ().erase (i->first);
- if (0) { O2CMap[i->first] = i->second; } else { assert (0 && "I don't think this is right - i->first is the real clone"); }
+ // We may have hosed the O2CMap with our replaceAllUses above.
+ // Fix it now.
+ for (ValueMap::iterator ii = O2CMap.begin (), ee = O2CMap.end ();
+ ii != ee; ++ii)
+ if (ii->second == i->first)
+ O2CMap[ii->first] = i->second;
}
}
More information about the llvm-commits
mailing list