parallaxinc / OpenSpin

Spin/PASM compiler for the Parallax Propeller.
56 stars 19 forks source link

Add summary and detail in Unused Method Removal results #25

Open PropGit opened 8 years ago

PropGit commented 8 years ago

Add a report summary that displays by default when a -u (Unused Method Removal) operation is performed, and an optional details report (via -v(erbose) switch).

The summary report appears after the object hierarchy:

<hierarchy structure here>
Optimized out # unused objects.
Optimized out # unused methods.
Optimization saved # longs.

where # is replaced by the actual number of objects, methods, and longs involved.

When -u is used with -v, it can report in a verbose way, such as:

Removed unused objects:
  parent1.object1
  parent1.child.object2
  parent2.child.child.object2
  parent2.child.object1
  parent3.object2
Removed unused methods:
  object3.method1
  object3.method2
  object4.method1
  object4.method5
  object4.method9
--------
Optimized out 2 unused objects.
Optimized out 5 unused methods.
Optimization saved # longs.

Note that it does not count the methods of completely removed objects in the tally of unused method.

reltham commented 8 years ago

I put in a first pass version of this in version 1.00.79. It's not really possible in the current setup to display object parents or multiple parents for eliminated objects. I'll be reworking the code more for tracking the objects as they process/build and then I can display better information here (as well as prevent circular references).

I'll leave this open until that gets done.

reltham commented 8 years ago

Fixed a bug that was tracking too many instances of removed methods (just in the tracking logic, not the actual removal logic). Also, added the object names in front of the methods in the report.

Still need to figure out the object parents being in front of removed objects, so this will be left open.