public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Deruupu Sutoomo <phdofthehouse@gmail.com>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: [ Plugins ] Read-only, or...?
Date: Mon, 12 Mar 2018 18:15:00 -0000	[thread overview]
Message-ID: <CAFiYyc0_AEX8SjFYqA08jKTqUatZ_MMCBaCej_egpu6pgHrgiQ@mail.gmail.com> (raw)
In-Reply-To: <CANHA4OgHBCx5yvvCrr=AZqejLchTgmnAhdCnsWKo47xtc56x7g@mail.gmail.com>

On Mon, Mar 12, 2018 at 3:47 PM, Deruupu Sutoomo
<phdofthehouse@gmail.com> wrote:
> Hello! I have a question regarding Plugins...
>
> I implemented a small one as a test to get used to working with GIMPLE and
> basic blocks. I read the Plugin API page, the wiki, and followed a tutorial
> to get started. However, I seem to have hit a bit of a road block in
> actually modifying the output of the compiled program itself.
>
> Are plugins a "read-only" look at the compilation model? If I wanted to
> provide an implementation of an intrinsic or modify a C++-compiled
> Translation Unit in some fashion, are plugins what I should be looking at?

plugins are not restricted to introspection, you have full access to all
internal GCC functions so modifying the IL is possible.

It might be easier to actually patch GCC though.

Richard.

> Background: I am attempting to add a function which relies on "compiler
> magic" and the file system to pull data made available to the program,
> replacing every instance of that function with the appropriate
> implementation (the data is to be constexpr).
>
> ( This is my first time on the mailing list, after carefully reading the
> descriptions for the others and asking around, this seemed to be
> appropriate. Let em know if I have the wrong space! )

  reply	other threads:[~2018-03-12 18:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 14:47 Deruupu Sutoomo
2018-03-12 18:15 ` Richard Biener [this message]
2018-03-12 20:13   ` Deruupu Sutoomo

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=CAFiYyc0_AEX8SjFYqA08jKTqUatZ_MMCBaCej_egpu6pgHrgiQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=phdofthehouse@gmail.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).