[cfe-dev] Partial Pre-processing Question

Yaron Keren via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 18 07:00:00 PST 2015


I don't know how to restrict expansion but compiler tests are usually
reduced to be independent of system headers, for the exact reason you
stated.
C-reduce is highly useful for this task:

  https://embed.cs.utah.edu/creduce/


2015-11-18 16:48 GMT+02:00 Martin J. O'Riordan via cfe-dev <
cfe-dev at lists.llvm.org>:

> 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.
>
>
>
> 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/fb657786/attachment.html>


More information about the cfe-dev mailing list