Pseudocode: Generate resolved-call-based read instructions for this-expressions
This commit is contained in:
@@ -22,7 +22,6 @@ import org.jetbrains.jet.lang.cfg.pseudocode.PseudoValue;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.Pseudocode;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.TypePredicate;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.eval.*;
|
||||
import org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
@@ -126,8 +125,6 @@ public interface JetControlFlowBuilder {
|
||||
@NotNull List<PseudoValue> inputValues
|
||||
);
|
||||
|
||||
@NotNull
|
||||
ReadValueInstruction readThis(@NotNull JetExpression expression, @Nullable ReceiverParameterDescriptor parameterDescriptor);
|
||||
@NotNull
|
||||
ReadValueInstruction readVariable(
|
||||
@NotNull JetElement instructionElement,
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.jetbrains.jet.lang.cfg.pseudocode.PseudoValue;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.Pseudocode;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.TypePredicate;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.eval.*;
|
||||
import org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
@@ -84,12 +83,6 @@ public abstract class JetControlFlowBuilderAdapter implements JetControlFlowBuil
|
||||
return getDelegateBuilder().merge(expression, inputValues);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ReadValueInstruction readThis(@NotNull JetExpression expression, @Nullable ReceiverParameterDescriptor parameterDescriptor) {
|
||||
return getDelegateBuilder().readThis(expression, parameterDescriptor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ReadValueInstruction readVariable(
|
||||
|
||||
@@ -288,13 +288,13 @@ public class JetControlFlowProcessor {
|
||||
public void visitThisExpressionVoid(@NotNull JetThisExpression expression, CFPContext context) {
|
||||
ResolvedCall<?> resolvedCall = getResolvedCall(expression);
|
||||
if (resolvedCall == null) {
|
||||
builder.readThis(expression, null);
|
||||
createNonSyntheticValue(expression);
|
||||
return;
|
||||
}
|
||||
|
||||
CallableDescriptor resultingDescriptor = resolvedCall.getResultingDescriptor();
|
||||
if (resultingDescriptor instanceof ReceiverParameterDescriptor) {
|
||||
builder.readThis(expression, (ReceiverParameterDescriptor) resultingDescriptor);
|
||||
builder.readVariable(expression, expression, resolvedCall, getReceiverValues(expression, resolvedCall, true));
|
||||
}
|
||||
|
||||
copyValue(expression, expression.getInstanceReference());
|
||||
|
||||
-7
@@ -25,7 +25,6 @@ import org.jetbrains.jet.lang.cfg.pseudocode.instructions.LexicalScope;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.eval.*;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.jumps.*;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.special.*;
|
||||
import org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
@@ -448,12 +447,6 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
|
||||
return instruction;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ReadValueInstruction readThis(@NotNull JetExpression expression, @Nullable ReceiverParameterDescriptor parameterDescriptor) {
|
||||
return read(expression);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ReadValueInstruction readVariable(
|
||||
|
||||
Reference in New Issue
Block a user