This replicates 'cl.exe' behavior and allows for both preprocessor output and
dependency information to be extraced with a single compiler invocation.
This is especially useful for compiler caching with tools like Mozilla's sccache.
Differential D46394
[clang-cl] Print /showIncludes to stderr, if used in combination with /E, /EP or /P fxb on May 3 2018, 8:28 AM. Authored by
Details
This replicates 'cl.exe' behavior and allows for both preprocessor output and This is especially useful for compiler caching with tools like Mozilla's sccache.
Diff Detail
Event TimelineComment Actions This is my first patch to clang, so any feedback regarding implementation appreciated! Also, let me know if you have any suggestions on how to add more extensive tests for this.
Comment Actions When building this, it didn't build since you'd reused the name. I changed the variable to be named "Dest" instead of "Destination" That said, the test suite now fails on Clang :: Frontend/print-header-includes.c'. Please do a build with 'check-clang' to see why this no longer works. Comment Actions I'll have a look at these issues tomorrow and submit a new patch then. Thanks for all your help so far! Comment Actions
|
Doing these two as separate options is a touch annoying. First, there is an extra state that ends up being possible but ignored. I'd prefer making a "PrintShowIncludeDestination : 2" (name open for proper bikeshed) that contains an enum so that the states are explicit. Something like:
None,
StdOut,
StdErr
That way, the 4th state is explicitly unused.