From: Carlos Maniero <carlos@maniero.me>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Carlos Maniero <carlos@maniero.me>
Subject: [PATCH olang v1 0/1] deref operation returning value
Date: Thu, 17 Oct 2024 02:48:53 +0000 (UTC) [thread overview]
Message-ID: <20241017024849.320062-1-carlos@maniero.me> (raw)
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
next reply other threads:[~2024-10-17 2:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 2:48 Carlos Maniero [this message]
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
2024-10-19 14:10 [PATCH olang v1 0/1] deref operation returning value Carlos Maniero
2024-10-19 14:14 ` Carlos Maniero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241017024849.320062-1-carlos@maniero.me \
--to=carlos@maniero.me \
--cc=~johnnyrichard/olang-devel@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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