Add directives-only preprocessing


When using clang with distributed build systems various errors may occur due to clang compiles
source code differently if it was previously preprocessed(see [1] for example). Is it an intentional behaviour?

As a solution for this kind of errors gcc provides “-fdirectives-only” flag([2]) to preprocess only directives, but prevent macro expansions outside of directives, which also speedups preprocessing
on local machine. Are there any plans to support this kind of feature? Are patches welcome?


Clang already has -frewrite-includes for this purpose.

If it actually does the same thing as GCC’s -fdirectives-only, I’d be happy to review a patch to provide that as an alias.