[Preprocessor] Support for '-dI' flag
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 28 Oct 2016 16:32:10 +0000 (16:32 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 28 Oct 2016 16:32:10 +0000 (16:32 +0000)
commitc9af134dda5a941c1addadf765e9360efe0e7766
treed8837b06c6e93059272cf0c8134288e3f6a0dd53
parent2b42ccc78b38e5b11305f7316e108882986f5aa9
[Preprocessor] Support for '-dI' flag

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/D25153

llvm-svn: 285411
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]