[Preprocessor] Support for '-dI' flag
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 17 Nov 2016 22:45:31 +0000 (22:45 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 17 Nov 2016 22:45:31 +0000 (22:45 +0000)
commit6fa3b742e0c77d54c7f3914f929dcac1c37a81d8
tree9a60151049d962aa2f8ce3af8f8e15ff861aeb96
parent592fa122c2a2873d04cf115d9939c0d7a4f35057
[Preprocessor] Support for '-dI' flag

Re-introduce r285411.

Implement the -dI as supported by GCC: Output ‘#include’ directives in addition
to the result of preprocessing.

This change aims to add this option, pass it through to the preprocessor via
the options class, and when inclusions occur we output some information (+ test
cases).

Patch by Steve O'Brien!

Differential Revision: https://reviews.llvm.org/D26089

llvm-svn: 287275
clang/include/clang/Driver/Options.td
clang/include/clang/Frontend/PreprocessorOutputOptions.h
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/PrintPreprocessedOutput.cpp
clang/test/Preprocessor/dump_import.h [new file with mode: 0644]
clang/test/Preprocessor/dump_import.m [new file with mode: 0644]
clang/test/Preprocessor/dump_include.c [new file with mode: 0644]
clang/test/Preprocessor/dump_include.h [new file with mode: 0644]