Re: c code inliner
2 Apr 2005 19:33:56 -0500

          From comp.compilers

Related articles
c code inliner (2005-03-31)
Re: c code inliner (Nathan Moore) (2005-04-02)
Re: c code inliner (Basile Starynkevitch \[news\]) (2005-04-02)
Re: c code inliner (2005-04-02)
Re: c code inliner (Eric Eide) (2005-04-02)
Re: c code inliner (A Pietu Pohjalainen) (2005-04-26)
Re: c code inliner (2005-04-30)
Re: c code inliner (Ira Baxter) (2005-05-04)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 2 Apr 2005 19:33:56 -0500
References: 05-03-122
Keywords: C
Posted-Date: 02 Apr 2005 19:33:56 EST

    Unfortunately, function inlining is a bit more complicated than macro
preprocessor. The code after inlining is usually written in
intermediate language, and not in C/C++. The are two problems when you
do this in C/C++:
1. You sometimes need renaming of variables in order to create the
right code. For example
    inline ... f ... { x ... }
          T x;
    .. f (.... x ...) /* in some cases, x should be renamed */
2. If an inline function call appears inside an expression, you
sometimes need to break it to several parts, compute the function call
value, and use it in the computation of the expression. For example
should usually be translated in C/C++ to
    {T reslt=f(...); /* expand f with the new var reslt */

    Michael wrote:
> Hi
> Can gcc or cpp produce c code after inlining?
> I.e. I only want my c code after inlining but not compiled.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.