aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2022-11-16 14:20:23 -0800
committerAkira Hatanaka <ahatanaka@apple.com>2022-12-07 15:30:19 -0800
commit3738ce05a70cf97fc73a07b158a1726f61aed28b (patch)
tree9eb6899ba3d2924b69b037af42b3ed84453a3203 /clang/lib/Driver/Driver.cpp
parent49e75ebd854dee1fcf5729c264f4cfadf76e952d (diff)
downloadllvm-3738ce05a70cf97fc73a07b158a1726f61aed28b.zip
llvm-3738ce05a70cf97fc73a07b158a1726f61aed28b.tar.gz
llvm-3738ce05a70cf97fc73a07b158a1726f61aed28b.tar.bz2
Add support for a backdoor driver option that enables emitting header
usage information in JSON to a file Each line in the file is a JSON object that has the name of the main source file followed by the list of system header files included directly or indirectly from that file. For example: {"source":"/tmp/foo.c", "includes":["/usr/include/stdio.h", "/usr/include/stdlib.h"]} To reduce the amount of data written to the file, only the system headers that are directly included from a non-system header file are recorded. In order to emit the header information in JSON, it is necessary to set the following environment variables: CC_PRINT_HEADERS_FORMAT=json CC_PRINT_HEADERS_FILTERING=only-direct-system The following combination is equivalent to setting CC_PRINT_HEADERS=1: CC_PRINT_HEADERS_FORMAT=textual CC_PRINT_HEADERS_FILTERING=none Differential Revision: https://reviews.llvm.org/D137996
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index cf0a596..969d385 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -198,7 +198,7 @@ Driver::Driver(StringRef ClangExecutable, StringRef TargetTriple,
ModulesModeCXX20(false), LTOMode(LTOK_None),
ClangExecutable(ClangExecutable), SysRoot(DEFAULT_SYSROOT),
DriverTitle(Title), CCCPrintBindings(false), CCPrintOptions(false),
- CCPrintHeaders(false), CCLogDiagnostics(false), CCGenDiagnostics(false),
+ CCLogDiagnostics(false), CCGenDiagnostics(false),
CCPrintProcessStats(false), TargetTriple(TargetTriple), Saver(Alloc),
CheckInputsExist(true), ProbePrecompiled(true),
SuppressMissingInputWarning(false) {