Add directives-only preprocessing

Hello!

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?

  1. http://petereisentraut.blogspot.ru/2011/09/ccache-and-clang-part-2.html
  2. https://gcc.gnu.org/ml/gcc-patches/2007-02/msg01125.html

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.