public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
* [PATCH olang v1 0/1] deref operation returning value
@ 2024-10-17  2:48 Carlos Maniero
  2024-10-17  2:48 ` [PATCH olang v1 1/1] codegen: x64: deref returns pointer value Carlos Maniero
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Maniero @ 2024-10-17  2:48 UTC (permalink / raw)
  To: ~johnnyrichard/olang-devel; +Cc: Carlos Maniero

We had discussed over IRC about may adding some extra information on the
deref operation to support this feature, but there are two reasons why I
opted to keep this on code gen:

1) Modifying the AST would require changing the unary data structure
from a struct to an union, but no other operator would be beneficed by
this since only the deref needs some extra information.

2) The assign operation is required to identify if its LHS is a deref,
once the mov instruction will differ from a simple ref: The simple ref
will mov the expression result to a RBP offset and the deref will mov
the expression result to the pointer location.

Also, once we have the IR, this logic could easily fit the layer that
will build the IR.

Carlos Maniero (1):
  codegen: x64: deref returns pointer value

 src/codegen_x86_64.c | 61 +++++++++++++++++++++++++++++++++++++-------
 1 file changed, 52 insertions(+), 9 deletions(-)

-- 
2.46.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-17  2:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-17  2:48 [PATCH olang v1 0/1] deref operation returning value Carlos Maniero
2024-10-17  2:48 ` [PATCH olang v1 1/1] codegen: x64: deref returns pointer value Carlos Maniero
2024-10-17  2:49   ` [olang/patches/.build.yml] build failed builds.sr.ht
2024-10-17  2:52     ` Carlos Maniero

Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox