Artem Shinkarov <artyom.shinkar...@gmail.com> writes:

> So my idea is to create just a light version of cpp binary. I'm not
> saying that we need to replace an existing approach of preprocessing
> used in gcc (cpp is basically "gcc -E"). I'm just saying that it could
> be a nice thing to have.
>
> I am ready to do that in terms of my project, but I need some help
> because I don't know all the internal secrets and features. So I ask
> for help in the design of such a thing. Of course if it does not sound
> like an absolutely useless.

I'm not sure this is useful for the gcc project.  However, I'm certainly
in favor of documenting internal API's in gcc, and if you can use that
to build the tool you want, then that would be fine.

There are no internal "secrets," of course.  The libcpp library API is
defined in libcpp/include/cpplib.h.  Specifically, you must set some
fields in a struct cpp_callbacks and you must call cpp_push_include to
set the header file search path.

You should probably start by looking at the file
gcc/c-family/c-ppoutput.c (just gcc/c-ppoutput.c in older releases) to
see what gcc does for -E.

You're going to have to do some digging to make this work.

Ian

Reply via email to