Re: post C++ template/inlining resolution (Greg Comeau)
5 Jun 2003 23:09:25 -0400

          From comp.compilers

Related articles
post C++ template/inlining resolution (Simon) (2003-05-24)
Re: post C++ template/inlining resolution (Ira Baxter) (2003-05-29)
Re: post C++ template/inlining resolution (2003-06-03)
Re: post C++ template/inlining resolution (2003-06-05)
Re: post C++ template/inlining resolution (2003-06-05)
| List of all articles for this month |

From: (Greg Comeau)
Newsgroups: comp.compilers,comp.lang.c++
Date: 5 Jun 2003 23:09:25 -0400
Organization: Comeau Computing;
References: 03-05-174 03-06-009
Keywords: C++
Posted-Date: 05 Jun 2003 23:09:25 EDT

Shane Beasley <> wrote:
>"Simon" <> wrote
>> I would like somehow to be able to define a set of C++ template types
>> (including inline methods that are fairly simple), and pass it through
>> something to get out an intermediate version (in C or some
>> representation that is vaguely human readable) so I can see what it
>> has resolved to and what the compiler has to play with.
>As I understand it, the Comeau compiler (
>compiles to an intermediate C form, which you would normally feed to a
>C compiler to produce an executable. However, that means that it
>should be possible to stop before the final step and get a peek at
>what the C code looks like. Unfortunately, since C doesn't support
>overloading, templates, etc., the names will probably all look quite
>weird. Also, since it *is* a compiler, it might optimize the C output
>such that it really has nothing much to do with the original C++
>source aside from that they both behave the same way.

Comeau does generate C, but it's an artifact of translation, and
normally not an option to get the C. Even if not, I'm unclear how it
addresses the original question. The things is that all template are
not necessarily instantiation (by a translation unit, or at all) and
further more, things such as default argument to functions may
implictly add overloads, etc, and that would not be apparent in any
intermediate form, since said things may not be emitted. I agree with
the OP that sometimes trying to know which functions were called it
tricky, but this does not necessarily let one see the candidates, etc.

Comeau C/C++ ONLINE ==>
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

Post a followup to this message

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