hanchenye-llvm-project/clang/test/Lexer
Alex Lorenz 6e2d36b60b Add clang source minimizer that reduces source to directives
that might affect the dependency list for a compilation

This commit introduces a dependency directives source minimizer to clang
that minimizes header and source files to the minimum necessary preprocessor
directives for evaluating includes. It reduces the source down to #define, #include,

The source minimizer works by lexing the input with a custom fast lexer that recognizes
the preprocessor directives it cares about, and emitting those directives in the minimized source.
It ignores source code, comments, and normalizes whitespace. It gives up and fails if seems
any directives that it doesn't recognize as valid (e.g. #define 0).

In addition to the source minimizer this patch adds a
-print-dependency-directives-minimized-source CC1 option that allows you to invoke the minimizer
from clang directly.

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

llvm-svn: 362459
2019-06-03 22:59:17 +00:00
..
Inputs
11-27-2007-FloatLiterals.c
aligned-allocation.cpp
asm-preproc-no-unicode.s
badstring_in_if0.c
bcpl-escaped-newline.c
block_cmt_end.c
builtin_redef.c
c90.c
case-insensitive-include-ms.c
case-insensitive-include-pr31836.sh
case-insensitive-include.c
case-insensitive-system-include.c
char-escapes.c
char-literal-encoding-error.c
char-literal.cpp
char8_t.cpp
comment-escape.c
conflict-marker.c
constants.c
coroutines.cpp
counter.c
cross-windows-on-linux-default.cpp
cross-windows-on-linux.cpp [CMake] Use normalized Windows target triples 2018-08-09 02:16:18 +00:00
cxx-features.cpp Enable coroutines under -std=c++2a. 2019-02-23 21:06:26 +00:00
cxx0x_keyword_as_cxx98.cpp
cxx0x_raw_string_delim_length.cpp
cxx0x_raw_string_directives.cpp
cxx0x_raw_string_unterminated.cpp
cxx1y_binary_literal.cpp
cxx1y_digit_separators.cpp
cxx1z-trigraphs.cpp
cxx2a-spaceship.cpp
cxx2a_keyword_as_cxx17.cpp Enable coroutines under -std=c++2a. 2019-02-23 21:06:26 +00:00
digraph.c
dollar-idents.c
eof-char.c
eof-conflict-marker.c
eof-file.c
eof-include.c Factor out repeated code parsing and concatenating header-names from 2019-03-19 01:51:19 +00:00
eof-number.c
eof-string.c
escape_newline.c
gnu-flags.c
half-literal.cpp [NFC] Explicitly add -std=c++14 option to tests that rely on the C++14 default 2019-02-05 12:05:53 +00:00
has_attribute_objc_boxable.m
has_extension.c
has_extension_cxx.cpp
has_feature_address_sanitizer.cpp
has_feature_boxed_nsvalue_expressions.m
has_feature_c1x.c
has_feature_cxx0x.cpp
has_feature_exceptions.cpp
has_feature_memory_sanitizer.cpp [MSan] add KMSAN support to Clang driver 2018-09-07 09:21:09 +00:00
has_feature_modules.m
has_feature_objc_arc.m
has_feature_rtti.cpp
has_feature_thread_sanitizer.cpp
has_feature_type_traits.cpp
has_feature_undefined_behavior_sanitizer.cpp [Lexer] Add udefined_behavior_sanitizer feature 2018-09-22 01:03:16 +00:00
has_feature_xray_instrument.cpp [Lexer] Add xray_instrument feature 2018-09-17 05:25:47 +00:00
header.cpp
hexfloat.cpp
keywords_test.c [MSVC] Recognize `static_assert` keyword in C and C++98 2019-02-15 19:59:45 +00:00
keywords_test.cpp [MSVC] Recognize `static_assert` keyword in C and C++98 2019-02-15 19:59:45 +00:00
long-long.cpp
minimize_source_to_dependency_directives_at_import_extra_tokens.m Add clang source minimizer that reduces source to directives 2019-06-03 22:59:17 +00:00
minimize_source_to_dependency_directives_at_import_missing_semi.m Add clang source minimizer that reduces source to directives 2019-06-03 22:59:17 +00:00
minimize_source_to_dependency_directives_invalid_macro_name.c Add clang source minimizer that reduces source to directives 2019-06-03 22:59:17 +00:00
modules-ts.cpp
ms-compatibility.c
ms-extensions.c
ms-extensions.cpp
msdos-cpm-eof.c
multiple-include.c
newline-eof-c++98-compat.cpp
newline-eof.c
newline-nul.c
null-character-in-literal.c
numeric-literal-trash.c
objc_macros.m
opencl-half-literal.cl
pragma-mark.c
pragma-message.c
pragma-message2.c
pragma-operators.cpp
pragma-region.c
preamble.c
preamble2.c
rdar-8914293.c
rdr-6096838-2.c
rdr-6096838.c
string-literal-encoding.c
string-literal-errors.cpp
string_concat.cpp
token-concat.c
token-concat.cpp
unicode-strings.c
unicode.c Don't emit "will be treated as an identifier character" warning for 2018-09-25 22:34:45 +00:00
unknown-char.c
utf-16.c
utf-16.c.txt
utf8-char-literal.cpp
utf8-invalid.c
warn-date-time.c
warn_binary_literals.cpp
wchar-signedness.c
wchar.c