[M3commit] CVS Update: cm3
Jay Krell
jkrell at elego.de
Sun Sep 12 13:44:30 CEST 2010
CVSROOT: /usr/cvs
Changes by: jkrell at birch. 10/09/12 13:44:30
Modified files:
cm3/m3-sys/m3cc/gcc/gcc/m3cg/: parse.c
Log message:
add indentation to tracing
The result is quite nice.
The code is a little gnarly how to decides to insert newlines but
the result is good.
Because sometimes outdent is because the operation is marked as such,
e.g. call_direct or end_procedure and sometimes it is by
getting the tail operations like params or fields
(notice that params are counted, locals are not, and some locals
follow params, e.g. "_result" so the formating is a bit off)
probably the multiplier shouldn't be sprinkled around either
and the space string construction could be more general and efficient,
i.e. grow it as needed instead of hardcoded size
e.g.
(118) declare_procedure quoted_string:Text__Length ...
(119) declare_local quoted_string:i ...
(120) declare_param quoted_string:t ...
(121) declare_local quoted_string:_result ...
(122) declare_procedure quoted_string:Text__Empty ...
when what you want is:
(118) declare_procedure quoted_string:Text__Length ...
(119) declare_local quoted_string:i ...
(120) declare_param quoted_string:t ...
(121) declare_local quoted_string:_result ...
(122) declare_procedure quoted_string:Text__Empty ...
...
Rewrite fmt_uid, for brevity and to avoid signed math.
(table lookup instead of if ladder)
(bikeshed perhaps)
a little cleanup/cosmetic:
memcpy instead of strcpy a constant (zzz)
remove comparisons to zero in boolean context
remove some braces
remove spaces at ends of lines (thought I already had)
forgot to mention earlier:
start, barely, consolidating the trace options
More information about the M3commit
mailing list