"Muhammed Fawzy" <mfawzymkh@xxxxxxxxxxx> writes: > That is great!, but is it possible that the plugin uses the same gcc > backend to emit the code, and only alter **part** of the instruction > stream? > I want to utilize the existing code, and only make a small change in > code generation. Yes. gcc generates code via a series of passes. A plugin can insert a new pass. That pass can adjust the instruction stream and pass it on to future passes. Ian > -------------------------------------------------- > From: "Ian Lance Taylor" <iant@xxxxxxxxxx> > Sent: Tuesday, December 22, 2009 7:53 AM > To: "Muhammed Fawzy" <mfawzymkh@xxxxxxxxxxx> > Cc: <gcc-help@xxxxxxxxxxx> > Subject: Re: Code Gen Plugins > >> "Muhammed Fawzy" <mfawzymkh@xxxxxxxxxxx> writes: >> >>> I would like to know if it is possible with GCC Plugins to write a >>> code gen plugin to modify certain things. >>> What I want to achieve is to use the gcc backend, but only change the >>> way callsites are generated, so the plugin should fallback to use >>> gcc, and only works when gcc tries to emit code to call functions.. >>> >>> is this something possible with gcc? >> >> If I understand you correctly, then the answer is yes. A plugin can >> insert new compilation passes which can manipulate the instruction >> steam however you like. >> >> Ian >>