[cfe-dev] Partial Pre-processing Question

Yaron Keren via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 18 09:11:01 PST 2015


It is feasible to add a command line switch to skip preprocessing for
system include files and instead print out the include as-is. Hack around
lib/Lex/PPDirectives.cpp.




2015-11-18 19:06 GMT+02:00 Martin J. O'Riordan <martin.oriordan at movidius.com
>:

> Thanks for this link, I hadn’t come across this before and I can see how I
> can put it to good use J
>
>
>
>             MartinO
>
>
>
> *From:* Yaron Keren [mailto:yaron.keren at gmail.com]
> *Sent:* 18 November 2015 15:00
> *To:* Martin J. O'Riordan <martin.oriordan at movidius.com>
> *Cc:* Clang Dev <cfe-dev at lists.llvm.org>
> *Subject:* Re: [cfe-dev] Partial Pre-processing Question
>
>
>
> 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/77355d7f/attachment.html>


More information about the cfe-dev mailing list