public TrimAnalysisMethodCallPattern Merge(ValueSetLattice <SingleValue> lattice, TrimAnalysisMethodCallPattern other)
        {
            Debug.Assert(MethodBody.OwningMethod == other.MethodBody.OwningMethod);
            Debug.Assert(Operation == other.Operation);
            Debug.Assert(Offset == other.Offset);
            Debug.Assert(Origin == other.Origin);
            Debug.Assert(CalledMethod == other.CalledMethod);
            Debug.Assert(Arguments.Length == other.Arguments.Length);

            var argumentsBuilder = ImmutableArray.CreateBuilder <MultiValue>();

            for (int i = 0; i < Arguments.Length; i++)
            {
                argumentsBuilder.Add(lattice.Meet(Arguments[i], other.Arguments[i]));
            }

            return(new TrimAnalysisMethodCallPattern(
                       MethodBody,
                       Operation,
                       Offset,
                       CalledMethod,
                       lattice.Meet(Instance, other.Instance),
                       argumentsBuilder.ToImmutable(),
                       Origin));
        }
 public TrimAnalysisVisitor(
     LocalStateLattice <MultiValue, ValueSetLattice <SingleValue> > lattice,
     OperationBlockAnalysisContext context
     ) : base(lattice, context)
 {
     _multiValueLattice   = lattice.Lattice.ValueLattice;
     TrimAnalysisPatterns = new TrimAnalysisPatternStore(_multiValueLattice);
 }
Exemple #3
0
 public TrimAnalysisVisitor(
     LocalStateLattice <MultiValue, ValueSetLattice <SingleValue> > lattice,
     OperationBlockAnalysisContext context,
     ImmutableDictionary <CaptureId, FlowCaptureKind> lValueFlowCaptures
     ) : base(lattice, context, lValueFlowCaptures)
 {
     _multiValueLattice   = lattice.Lattice.ValueLattice;
     TrimAnalysisPatterns = new TrimAnalysisPatternStore(_multiValueLattice);
 }
 public InterproceduralStateLattice(
     ValueSetLattice <MethodBodyValue> methodBodyLattice,
     DictionaryLattice <HoistedLocalKey, MultiValue, ValueSetLattice <SingleValue> > hoistedLocalsLattice)
 => (MethodBodyLattice, HoistedLocalsLattice) = (methodBodyLattice, hoistedLocalsLattice);
 public InterproceduralStateLattice(
     ILProvider ilProvider,
     ValueSetLattice <MethodBodyValue> methodBodyLattice,
     DictionaryLattice <HoistedLocalKey, MultiValue, ValueSetLattice <SingleValue> > hoistedLocalsLattice)
 => (_ilProvider, MethodBodyLattice, HoistedLocalsLattice) = (ilProvider, methodBodyLattice, hoistedLocalsLattice);