Exemplo n.º 1
0
 protected sealed override void ComputeHashCodeParts(Action <int> addPart)
 {
     addPart(ValueDomain.GetHashCode());
     addPart(OwningSymbol.GetHashCode());
     addPart(ControlFlowGraph.OriginalOperation.GetHashCode());
     addPart(AnalyzerOptions.GetHashCode());
     addPart(InterproceduralAnalysisConfiguration.GetHashCode());
     addPart(PessimisticAnalysis.GetHashCode());
     addPart(PredicateAnalysis.GetHashCode());
     addPart(ExceptionPathsAnalysis.GetHashCode());
     addPart(CopyAnalysisResultOpt.GetHashCodeOrDefault());
     addPart(PointsToAnalysisResultOpt.GetHashCodeOrDefault());
     addPart(ValueContentAnalysisResultOpt.GetHashCodeOrDefault());
     addPart(InterproceduralAnalysisDataOpt.GetHashCodeOrDefault());
     addPart(InterproceduralAnalysisPredicateOpt.GetHashCodeOrDefault());
     ComputeHashCodePartsSpecific(addPart);
 }
 protected sealed override void ComputeHashCodeParts(ref RoslynHashCode hashCode)
 {
     hashCode.Add(ValueDomain.GetHashCode());
     hashCode.Add(OwningSymbol.GetHashCode());
     hashCode.Add(ControlFlowGraph.GetHashCode());
     hashCode.Add(AnalyzerOptions.GetHashCode());
     hashCode.Add(InterproceduralAnalysisConfiguration.GetHashCode());
     hashCode.Add(PessimisticAnalysis.GetHashCode());
     hashCode.Add(PredicateAnalysis.GetHashCode());
     hashCode.Add(ExceptionPathsAnalysis.GetHashCode());
     hashCode.Add(CopyAnalysisResult.GetHashCodeOrDefault());
     hashCode.Add(PointsToAnalysisResult.GetHashCodeOrDefault());
     hashCode.Add(ValueContentAnalysisResult.GetHashCodeOrDefault());
     hashCode.Add(InterproceduralAnalysisData.GetHashCodeOrDefault());
     hashCode.Add(InterproceduralAnalysisPredicate.GetHashCodeOrDefault());
     ComputeHashCodePartsSpecific(ref hashCode);
 }
        protected sealed override bool ComputeEqualsByHashCodeParts(CacheBasedEquatable <TAnalysisContext> obj)
        {
            var other = (AbstractDataFlowAnalysisContext <TAnalysisData, TAnalysisContext, TAnalysisResult, TAbstractAnalysisValue>)obj;

            return(ValueDomain.GetHashCode() == other.ValueDomain.GetHashCode() &&
                   OwningSymbol.GetHashCode() == other.OwningSymbol.GetHashCode() &&
                   ControlFlowGraph.GetHashCode() == other.ControlFlowGraph.GetHashCode() &&
                   AnalyzerOptions.GetHashCode() == other.AnalyzerOptions.GetHashCode() &&
                   InterproceduralAnalysisConfiguration.GetHashCode() == other.InterproceduralAnalysisConfiguration.GetHashCode() &&
                   PessimisticAnalysis.GetHashCode() == other.PessimisticAnalysis.GetHashCode() &&
                   PredicateAnalysis.GetHashCode() == other.PredicateAnalysis.GetHashCode() &&
                   ExceptionPathsAnalysis.GetHashCode() == other.ExceptionPathsAnalysis.GetHashCode() &&
                   CopyAnalysisResult.GetHashCodeOrDefault() == other.CopyAnalysisResult.GetHashCodeOrDefault() &&
                   PointsToAnalysisResult.GetHashCodeOrDefault() == other.PointsToAnalysisResult.GetHashCodeOrDefault() &&
                   ValueContentAnalysisResult.GetHashCodeOrDefault() == other.ValueContentAnalysisResult.GetHashCodeOrDefault() &&
                   InterproceduralAnalysisData.GetHashCodeOrDefault() == other.InterproceduralAnalysisData.GetHashCodeOrDefault() &&
                   InterproceduralAnalysisPredicate.GetHashCodeOrDefault() == other.InterproceduralAnalysisPredicate.GetHashCodeOrDefault() &&
                   ComputeEqualsByHashCodeParts(other));
        }