[nem-en] T2 pass (Typer2) in IntelliSenseMode

Michal Moskal michal.moskal at gmail.com
Sun Feb 18 17:51:30 CET 2007


On 2/18/07, vc <vc at rsdn.ru> wrote:
> > If you want all the errors you would probably want to go through all
> > the passes. OTOH I would still suggest using representation before T2
> > for intelli sense purposes, as it is more syntax-like (like properties
> > are not yet transformed to calls and so on).
>
> Me interests what changes are done with TExpr on each pass?

T2 generally makes the tree more uniform by removing constructs like
properties, events, blocks and cache-expressions. It also reports a
bunch of usage-related warnings, some other warnings and can emit
errors in case when for example it doesn't know how to make a
functional value out of something (not likely in common code).

T3 removes other constructs, mainly local function definitions. They
are changed to either loops, static methods or classes implementing
functional interfaces. It also compile matching down to if
instructions.

T4 adds some magic conversions in place of boxing/unboxing casts,
marks TExpr nodes depending on whether they finish (you cannot emit
instructions after 'throw', 'ret' and the like in IL). This is just a
final fixup before IL generation. It might complain about 'goto's used
at the wrong level (for example to exit a function) or throw usage.

>
> PS
>
> We make a resolve to attach to PExpr references to objects (like TExpr)
> generated at typification. Whether they can change during typification?

I don't quite understand, but each typer stage generally produces new
typed tree objects.

-- 
   Michał


More information about the devel-en mailing list