public override void Visit(StructAss structAss) { var objectExpr = new ExpressionSimplifierVisitor().Visit(structAss.IdExpr); var objectExprResult = new ExpressionGeneratorVisitor(_state).Visit(objectExpr); var expr = new ExpressionSimplifierVisitor().Visit(structAss.Expr); var exprResult = new ExpressionGeneratorVisitor(_state).Visit(expr); var nextRegister1 = _state.NewRegister; var field = _globalState.NameToClass[objectExprResult.Type.GetText()].Fields[structAss.Id]; var fieldTypeString = objectExprResult.Type.GetText(); _llvmGenerator.Emit($"{nextRegister1} = getelementptr %{fieldTypeString}, " + $"%{fieldTypeString}* {objectExprResult.Register}, i32 0, i32 {field.Number + 1}"); _llvmGenerator.Emit($"store {AstToLlvmString.Type(exprResult.Type)} {exprResult.Register}, " + $"{AstToLlvmString.Type(field.Type)}* {nextRegister1}"); }
public virtual void Visit(StructAss structAss) { }