[cfe-dev] Partial Pre-processing Question

Martin J. O'Riordan via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 18 09:06:36 PST 2015


Thanks for this link, I hadn’t come across this before and I can see how I can put it to good use :)

 

            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 <mailto: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 <mailto: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/2b1d3166/attachment.html>


More information about the cfe-dev mailing list