icode: remove method information in IAbort
[nit.git] / src / compiling / compiling_icode.nit
index 847280b..d14b322 100644 (file)
@@ -283,12 +283,11 @@ redef class IRoutine
                else
                        v.add_decl("struct WBT_ **CREG = NULL;")
                end
-               var i = 0
+               var k = 0
                for r in params do
-                       if r.slot_index != null then v.add_assignment(v.register(r), args[i])
-                       i += 1
+                       if r.slot_index != null then v.add_assignment(v.register(r), args[k])
+                       k += 1
                end
-               var iclosdecls = closure_decls
                if iclosdecls != null then
                        for i in [0..iclosdecls.length[ do
                                var iclosdecl = iclosdecls[i]
@@ -358,7 +357,9 @@ redef class ICode
                if r != null and r.slot_index != null then
                        assert s != null
                        v.add_assignment(v.register(r), s)
-               else if s != null and not self isa IMove then
+               else if s != null and not is_pure then
+                       # ICode with side effects must be evaluated
+                       # even if the result is not wanted
                        v.add_instr(s + ";")
                end
        end
@@ -573,16 +574,11 @@ redef class IAbort
                v.add_instr(s.to_s)
 
                var ll = location
-               var pl = property_location
-               s = new Buffer.from("fprintf(stderr, \"")
-               if pl != null then s.append(" in %s")
-               s.append(" (%s")
+               s = new Buffer.from("fprintf(stderr, \" (%s")
                if ll != null then
                        s.append(":%d")
                end
-               s.append(")\\n\", ")
-               if pl != null then s.append("LOCATE_{pl.cname}, ")
-               s.append("LOCATE_{module_location.name}")
+               s.append(")\\n\", LOCATE_{module_location.name}")
                if ll != null then
                        s.append(", {ll.line_start}")
                end