summaryrefslogtreecommitdiff
path: root/include/clang/Basic/DiagnosticLexKinds.td
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2019-06-03 22:59:17 +0000
committerAlex Lorenz <arphaman@gmail.com>2019-06-03 22:59:17 +0000
commite92b41ea8c68738b6362a31ad98cd1d8894266fb (patch)
tree1a5fa409ea7a7ac1b3b123a2f521121e3341e031 /include/clang/Basic/DiagnosticLexKinds.td
parent3fb6bc0a3f0a0fbbe02db23219d5abd5a4af6766 (diff)
downloadclang-e92b41ea8c68738b6362a31ad98cd1d8894266fb.tar.gz
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticLexKinds.td')
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td
index dd5e2af3d2..b64cbc23f8 100644
--- a/include/clang/Basic/DiagnosticLexKinds.td
+++ b/include/clang/Basic/DiagnosticLexKinds.td
@@ -818,4 +818,13 @@ def err_pp_eof_in_assume_nonnull : Error<
}
+let CategoryName = "Dependency Directive Source Minimization Issue" in {
+
+def err_dep_source_minimizer_missing_sema_after_at_import : Error<
+ "could not find ';' after @import">;
+def err_dep_source_minimizer_unexpected_tokens_at_import : Error<
+ "unexpected extra tokens at end of @import declaration">;
+
+}
+
}