public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [ Plugins ] Read-only, or...?
@ 2018-03-12 14:47 Deruupu Sutoomo
  2018-03-12 18:15 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Deruupu Sutoomo @ 2018-03-12 14:47 UTC (permalink / raw)
  To: gcc

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?

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! )

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

* Re: [ Plugins ] Read-only, or...?
  2018-03-12 14:47 [ Plugins ] Read-only, or...? Deruupu Sutoomo
@ 2018-03-12 18:15 ` Richard Biener
  2018-03-12 20:13   ` Deruupu Sutoomo
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2018-03-12 18:15 UTC (permalink / raw)
  To: Deruupu Sutoomo; +Cc: GCC Development

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! )

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

* Re: [ Plugins ] Read-only, or...?
  2018-03-12 18:15 ` Richard Biener
@ 2018-03-12 20:13   ` Deruupu Sutoomo
  0 siblings, 0 replies; 3+ messages in thread
From: Deruupu Sutoomo @ 2018-03-12 20:13 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Development

Alright! I was trying to avoid touching internal functions, but I suppose
it would have to be inevitable.

Before I got diving into the old archives, documentation and blog posts, do
you have any pointers for where I should look to get started -- especially
for using GCC internals?

On Mon, Mar 12, 2018 at 2:15 PM, Richard Biener <richard.guenther@gmail.com>
wrote:

> 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! )
>

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

end of thread, other threads:[~2018-03-12 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 14:47 [ Plugins ] Read-only, or...? Deruupu Sutoomo
2018-03-12 18:15 ` Richard Biener
2018-03-12 20:13   ` Deruupu Sutoomo

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).