From 0e03fee9d38bf23934b6ffc7296dddc70fe62d5a Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 6 Oct 2015 22:23:19 -0400 Subject: [PATCH] typing: use `location` attribute instead of `node` to isolate CallSite from the AST Signed-off-by: Jean Privat --- src/semantize/auto_super_init.nit | 4 ++-- src/semantize/typing.nit | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/semantize/auto_super_init.nit b/src/semantize/auto_super_init.nit index 4a432c7..1da19d4 100644 --- a/src/semantize/auto_super_init.nit +++ b/src/semantize/auto_super_init.nit @@ -127,7 +127,7 @@ redef class AMethPropdef var msignature = candidatedef.new_msignature or else candidatedef.msignature msignature = msignature.resolve_for(recvtype, anchor, mmodule, true) - var callsite = new CallSite(self, recvtype, mmodule, anchor, true, candidate, candidatedef, msignature, false) + var callsite = new CallSite(hot_location, recvtype, mmodule, anchor, true, candidate, candidatedef, msignature, false) auto_super_inits.add(callsite) modelbuilder.toolcontext.info("Old-style auto-super init for {mpropdef} to {candidate.full_name}", 4) end @@ -162,7 +162,7 @@ redef class AMethPropdef var msignature = candidatedef.new_msignature or else candidatedef.msignature msignature = msignature.resolve_for(recvtype, anchor, mmodule, true) - var callsite = new CallSite(self, recvtype, mmodule, anchor, true, the_root_init_mmethod, candidatedef, msignature, false) + var callsite = new CallSite(hot_location, recvtype, mmodule, anchor, true, the_root_init_mmethod, candidatedef, msignature, false) auto_super_inits.add(callsite) modelbuilder.toolcontext.info("Auto-super init for {mpropdef} to {the_root_init_mmethod.full_name}", 4) end diff --git a/src/semantize/typing.nit b/src/semantize/typing.nit index 4a00d04..d0c34ac 100644 --- a/src/semantize/typing.nit +++ b/src/semantize/typing.nit @@ -389,7 +389,7 @@ private class TypeVisitor end end - var callsite = new CallSite(node, recvtype, mmodule, anchor, recv_is_self, mproperty, mpropdef, msignature, erasure_cast) + var callsite = new CallSite(node.hot_location, recvtype, mmodule, anchor, recv_is_self, mproperty, mpropdef, msignature, erasure_cast) return callsite end @@ -621,8 +621,8 @@ end # A specific method call site with its associated informations. class CallSite - # The associated node for location - var node: ANode + # The associated location of the callsite + var location: Location # The static type of the receiver (possibly unresolved) var recv: MType @@ -1977,7 +1977,7 @@ redef class ASuperExpr var msignature = superprop.new_msignature or else superprop.msignature.as(not null) msignature = v.resolve_for(msignature, recvtype, true).as(MSignature) - var callsite = new CallSite(self, recvtype, v.mmodule, v.anchor, true, superprop.mproperty, superprop, msignature, false) + var callsite = new CallSite(hot_location, recvtype, v.mmodule, v.anchor, true, superprop.mproperty, superprop, msignature, false) self.callsite = callsite var args = self.n_args.to_a -- 1.7.9.5