mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Factor silly code duplication out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e30e1cf029
commit
5fb724332a
@ -74,21 +74,16 @@ bool DTE::run(Module &M) {
|
|||||||
// Loop over all entries in the type plane...
|
// Loop over all entries in the type plane...
|
||||||
SymbolTable::VarMap &Plane = STI->second;
|
SymbolTable::VarMap &Plane = STI->second;
|
||||||
for (SymbolTable::VarMap::iterator PI = Plane.begin(); PI != Plane.end();)
|
for (SymbolTable::VarMap::iterator PI = Plane.begin(); PI != Plane.end();)
|
||||||
if (ShouldNukeSymtabEntry(*PI)) { // Should we remove this entry?
|
// If this entry should be unconditionally removed, or if we detect that
|
||||||
|
// the type is not used, remove it.
|
||||||
|
//
|
||||||
|
if (ShouldNukeSymtabEntry(*PI) ||
|
||||||
|
!UsedTypes.count(cast<Type>(PI->second))) {
|
||||||
#if MAP_IS_NOT_BRAINDEAD
|
#if MAP_IS_NOT_BRAINDEAD
|
||||||
PI = Plane.erase(PI); // STD C++ Map should support this!
|
PI = Plane.erase(PI); // STD C++ Map should support this!
|
||||||
#else
|
#else
|
||||||
Plane.erase(PI); // Alas, GCC 2.95.3 doesn't *SIGH*
|
Plane.erase(PI); // Alas, GCC 2.95.3 doesn't *SIGH*
|
||||||
PI = Plane.begin();
|
PI = Plane.begin();
|
||||||
#endif
|
|
||||||
++NumKilled;
|
|
||||||
Changed = true;
|
|
||||||
} else if (!UsedTypes.count(cast<Type>(PI->second))) {
|
|
||||||
#if MAP_IS_NOT_BRAINDEAD
|
|
||||||
PI = Plane.erase(PI); // STD C++ Map should support this!
|
|
||||||
#else
|
|
||||||
Plane.erase(PI); // Alas, GCC 2.95.3 doesn't *SIGH*
|
|
||||||
PI = Plane.begin(); // N^2 algorithms are fun. :(
|
|
||||||
#endif
|
#endif
|
||||||
++NumKilled;
|
++NumKilled;
|
||||||
Changed = true;
|
Changed = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user