<div dir="rtl"><div dir="ltr">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. </div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-11-18 19:06 GMT+02:00 Martin J. O'Riordan <span dir="ltr"><<a href="mailto:martin.oriordan@movidius.com" target="_blank">martin.oriordan@movidius.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-IE" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#943634">Thanks for this link, I hadn’t come across this before and I can see how I can put it to good use </span><span style="font-family:Wingdings;color:#943634">J</span><span style="font-family:"Book Antiqua",serif;color:#943634"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#943634"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#943634">            MartinO<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#943634"><u></u> <u></u></span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Yaron Keren [mailto:<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>] <br><b>Sent:</b> 18 November 2015 15:00<span class=""><br><b>To:</b> Martin J. O'Riordan <<a href="mailto:martin.oriordan@movidius.com" target="_blank">martin.oriordan@movidius.com</a>><br><b>Cc:</b> Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br><b>Subject:</b> Re: [cfe-dev] Partial Pre-processing Question<u></u><u></u></span></span></p><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">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. <u></u><u></u></p></div><div><div class="h5"><div><p class="MsoNormal">C-reduce is highly useful for this task:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">  <a href="https://embed.cs.utah.edu/creduce/" target="_blank">https://embed.cs.utah.edu/creduce/</a><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div><div><div class="h5"><div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">2015-11-18 16:48 GMT+02:00 Martin J. O'Riordan via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>:<u></u><u></u></p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif">I am wondering if there is some hidden option or mechanism in CLang that I can use to pre-process like ‘</span><span style="font-family:"Courier New"">-E</span><span style="font-family:"Book Antiqua",serif">’ or ‘</span><span style="font-family:"Courier New"">-frewrite-includes</span><span style="font-family:"Book Antiqua",serif">’, but which does not expand the headers from the system include directories?</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif">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.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif">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 ‘</span><span style="font-family:"Courier New"">#include <<i>sysheadername</i>></span><span style="font-family:"Book Antiqua",serif">’.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif">Thanks,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif">            MartinO - Movidius Ltd.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif"> </span><u></u><u></u></p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></blockquote></div><br></div>