public void DereferenceToRegister( Register target, CodeGen codeGen, ILinkingInfo fixer, GenericBrotherAction brotherAction, GenericFromDrefAction drefAction, GenericFromDref2Action dref2Action, GenericFromDref3Action dref3Action, GenericFromDref4Action dref4Action ) { switch (Kind) { case ResultKind.Value: DereferenceToRegister(target, brotherAction); return; case ResultKind.Pointer: DereferenceToRegister(target, drefAction); return; case ResultKind.Pointer2: DereferenceToRegister(target, dref2Action); return; case ResultKind.Pointer3: DereferenceToRegister(target, dref3Action); return; case ResultKind.Offset: DereferenceToRegister(target, codeGen, dref4Action, fixer); return; default: throw new NotImplementedException($"{nameof(ExpressionResult)}: {nameof(GenerateMoveTo)} has not implemented kind: {Kind}"); } }
private void DereferenceToRegister(Register target, GenericFromDrefAction action) { action(target, Ptr, Offset, Ptr == Register64.RSP || Ptr == Register64.RBP ? Segment.SS : Segment.DS); }