public VariableFlags Assignment( IAssignmentExpression assignmentExpression, VariableFlags definitelyAssigned) { return(assignmentExpression.LeftOperand switch { INameExpression identifier => definitelyAssigned.Set(identifier.ReferencedSymbol, true), IFieldAccessExpression _ => definitelyAssigned, _ => throw new NotImplementedException("Complex assignments not yet implemented") });
public TempValue?AddFieldAccess(IFieldAccessExpression fieldAccess) { var referenceType = fieldAccess.DataType.Known().UnderlyingReferenceType(); if (referenceType is null) { return(null); } var reference = ReferenceToFieldAccess(fieldAccess); var temp = ReferenceGraph.AddTempValue(fieldAccess, referenceType); temp.AddReference(reference); return(temp); }
private Reference ReferenceToFieldAccess(IFieldAccessExpression expression) { return(ReferenceToExpressionObject(expression)); }