[cfe-dev] Partial Pre-processing Question

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 18 07:49:00 PST 2015


On Wed, Nov 18, 2015 at 6:48 AM, Martin J. O'Riordan via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> I am wondering if there is some hidden option or mechanism in CLang that I
> can use to pre-process like ‘-E’ or ‘-frewrite-includes’, but which does
> not expand the headers from the system include directories?
>
>
>
> There are often times when I would like this type of capability, so that I
> can create test-cases for reported bug, but have them remain valid with
> future revisions of the compiler and its supporting headers and libraries.
> It is not uncommon for a new version of a system header (ISO C, ISO C++, or
> our own extended headers) to have changes that are not 100% compatible with
> the results of the expanded result of an older version.
>

I'm not quite following what you've said here /\ - if the test case has
fully preprocessed code then it won't have any system headers to conflict
with updated system headers, no? It'll be standalone. I've certainly found
these sort of test cases to be fairly robust - but I usually do the
reduction (as Yaron was mentioning) up-front, so I may not've run into the
situations you're describing. Given how much the compiler has to be robust
to user code backwards compatibility, I'd be surprised it it's often the
case that a system header used a feature that the compiler soon became
incapable of processing.


>
>
> The headers belonging to the programmer and their source need to be
> expanded, but I would like to retain the unexpanded system headers, and in
> particular not expand the macros defined in a system header, and leave the
> system headers as ‘#include <*sysheadername*>’.
>
>
>
> Thanks,
>
>
>
>             MartinO - Movidius Ltd.
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151118/0622288f/attachment.html>


More information about the cfe-dev mailing list