icode: ITypeCheck requires a receiver
authorJean Privat <jean@pryen.org>
Fri, 25 Nov 2011 15:07:49 +0000 (10:07 -0500)
committerJean Privat <jean@pryen.org>
Fri, 25 Nov 2011 15:07:49 +0000 (10:07 -0500)
commit60d5705cc287dcb8cd7d0c84fecb1055d88ad6e9
treefa5968fd6533a9bbff3773a7d3b7019c11d06400
parent49668cbe2bcbace9c961a24ae2878834f8b567f5
icode: ITypeCheck requires a receiver

For complex type checks that involve virtual types or generics,
a receiver is required.

For instance, with T a virtual type and x a variable
   x isa T
is in fact
   x isa self.T

This patch transforms the ITypeCheck from a ICode1 to a ICode2,
where expr1 is the receiver of the type and expr2 is the variable to test.

Clients of ITypeCheck are updated without change of behaviour.
Note that, strangely, during the icode_generation, the register that hold
self is lost, a new attribute is therefore added in A2IContext to store it.

Signed-off-by: Jean Privat <jean@pryen.org>
src/analysis/icode_dump.nit
src/compiling/compiling_icode.nit
src/icode/icode_base.nit
src/icode/icode_builder.nit
src/icode/icode_tools.nit
src/syntax/icode_generation.nit