public override LocalList <IDeclaredElement> GetMarkedFunctionsFrom(ITreeNode currentNode, IDeclaredElement containingFunction) { var result = new LocalList <IDeclaredElement>(); switch (currentNode) { case IInvocationExpression invocationExpression when PerformanceCriticalCodeStageUtil.IsInvocationExpensive(invocationExpression): case IReferenceExpression referenceExpression when PerformanceCriticalCodeStageUtil.IsCameraMainUsage(referenceExpression): case IAttributesOwner attributesOwner when PerformanceCriticalCodeStageUtil.HasPerformanceSensitiveAttribute(attributesOwner): result.Add(containingFunction); break; } return(result); }
public override LocalList <IDeclaredElement> GetMarkedFunctionsFrom(ITreeNode currentNode, IDeclaredElement containingFunction) { var result = new LocalList <IDeclaredElement>(); switch (currentNode) { case IInvocationExpression invocationExpression when PerformanceCriticalCodeStageUtil.IsInvocationExpensive(invocationExpression): case IReferenceExpression referenceExpression when PerformanceCriticalCodeStageUtil.IsCameraMainUsage(referenceExpression): case IEqualityExpression equalityExpressionParam when PerformanceCriticalCodeStageUtil.IsNullComparisonWithUnityObject(equalityExpressionParam, out _): case IFunctionDeclaration functionDeclaration when PerformanceCriticalCodeStageUtil.HasPerformanceSensitiveAttribute(functionDeclaration): result.Add(containingFunction); break; } return(result); }
public void ProcessBeforeInterior(ITreeNode element) { switch (element) { case IInvocationExpression invocationExpression when PerformanceCriticalCodeStageUtil.IsInvocationExpensive(invocationExpression): case IReferenceExpression referenceExpression when PerformanceCriticalCodeStageUtil.IsCameraMainUsage(referenceExpression): case IAttributesOwnerDeclaration attributesOwnerDeclaration when attributesOwnerDeclaration.DeclaredElement is IAttributesOwner attributesOwner && PerformanceCriticalCodeStageUtil.HasPerformanceSensitiveAttribute(attributesOwner): { IsExpensiveCodeFound = true; break; } } }