Ejemplo n.º 1
0
        public bool IsMethodCallThatIsNotNull(IMethodSymbol method)
        {
            using (new OperationTimer(i => Timings.Update(TimingOperation.SymbolLookup, i)))
            {
                var reduced = method.OriginalDefinition.ReducedFrom ?? method.OriginalDefinition;

                if (NotNullFrameworkMethods.Contains(reduced) || ExternalNotNullMethods.Contains(reduced))
                {
                    return(true);
                }
                return(false);
            }
        }
Ejemplo n.º 2
0
        private static void AnalyzeModel(SemanticModelAnalysisContext context)
        {
            using (new OperationTimer(i => Timings.Update(TimingOperation.ClassAnalyzer, i)))
            {
                try
                {
                    SetupCustomNotNullMethods(context.SemanticModel.Compilation, context.Options);
                    new ClassAnalyzer(context).Analyze(context.SemanticModel);
                }
                catch (ParseFailedException ex)
                {
                    context.ReportDiagnostic(Diagnostic.Create(ParseFailed, ex.Location, ex.Message));
#if DEBUG
                    throw;
#endif
                }
            }
        }