Re: c code inliner

tmk@netvision.net.il
2 Apr 2005 19:33:56 -0500

          From comp.compilers

Related articles
c code inliner paulw@mmail.ath.cx (2005-03-31)
Re: c code inliner nathan.moore@sdc.cox.net (Nathan Moore) (2005-04-02)
Re: c code inliner basile-news@starynkevitch.net (Basile Starynkevitch \[news\]) (2005-04-02)
Re: c code inliner tmk@netvision.net.il (2005-04-02)
Re: c code inliner eeide@cs.utah.edu (Eric Eide) (2005-04-02)
Re: c code inliner pohjalai@cc.helsinki.fi (A Pietu Pohjalainen) (2005-04-26)
Re: c code inliner gtoal@gtoal.com (2005-04-30)
Re: c code inliner idbaxter@semdesigns.com (Ira Baxter) (2005-05-04)
| List of all articles for this month |

From: tmk@netvision.net.il
Newsgroups: comp.compilers
Date: 2 Apr 2005 19:33:56 -0500
Organization: http://groups.google.com
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
    d=g(...f(...)...);
should usually be translated in C/C++ to
    {T reslt=f(...); /* expand f with the new var reslt */
      d=g(...reslt...);
    }


    Michael


paulw@mmail.ath.cx 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.