protected override InternalStatement RestoreImplementation <TNode>(
            GraphStructuredProgram <TNode> program,
            ResolvedMethod <TNode> owner,
            InternalStatement statement)
        {
            var invocation = (ResolvedInvocationStatement <TNode>)statement;

            var restoredEntity = EntitiesRestorer.Restore(program, owner, invocation.TargetEntity);

            var restoredPassedParameters =
                invocation.PassedParameters.ToDictionary(
                    pair => (SecondaryEntity)EntitiesRestorer.Restore(program, owner, pair.Key),
                    pair => pair.Value);

            var restoredReturnedValues =
                invocation.ReturnedValues.ToDictionary(
                    pair => pair.Key,
                    pair => (SecondaryEntity)EntitiesRestorer.Restore(program, owner, pair.Value));

            return(new ResolvedInvocationStatement <TNode>(
                       invocation,
                       restoredEntity,
                       invocation.TargetMethodId,
                       restoredPassedParameters,
                       restoredReturnedValues));
        }
Exemple #2
0
        protected override InternalStatement RestoreImplementation <TNode>(
            GraphStructuredProgram <TNode> program,
            ResolvedMethod <TNode> method,
            InternalStatement statement)
        {
            var assignment = (ResolvedAssignmentStatement)statement;

            var source = EntitiesRestorer.Restore(program, method, assignment.Source);

            Trace.Assert(assignment.Target != null);
            var target = assignment.Target == null ? null : EntitiesRestorer.Restore(program, method, assignment.Target);

            Trace.Assert(target is SecondaryEntity);

            return(new ResolvedAssignmentStatement(
                       assignment.Location, source, (SecondaryEntity)target, assignment.TargetReferencedByThis));
        }