Generate Libclang invocation reproducers using a new -cc1gen-reproducer
authorAlex Lorenz <arphaman@gmail.com>
Fri, 6 Apr 2018 18:30:14 +0000 (18:30 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Fri, 6 Apr 2018 18:30:14 +0000 (18:30 +0000)
commit1e720916faa6f632ab8c77fb46f055f1dace96f1
treea3c81a0395065a49a0eb5e0064f088a7070d84dc
parent181501a6b95116f87bb850dc410b855d7ebedc0b
Generate Libclang invocation reproducers using a new -cc1gen-reproducer
driver option

This commit is a follow up to the previous work that recorded Libclang invocations
into temporary files: r319702.

It adds a new -cc1 mode to clang: -cc1gen-reproducer. The goal of this mode is to generate
Clang reproducer files for Libclang tool invocation. The JSON format in the invocation
files is not really intended to be stable, so Libclang and Clang should be of the same version
when generating reproducers.
The new mode emits the information about the temporary files and Libclang-specific information
to stdout using JSON.

rdar://35322614

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

llvm-svn: 329442
clang/include/clang/Driver/Driver.h
clang/lib/Driver/Driver.cpp
clang/test/Index/create-libclang-completion-reproducer.c [new file with mode: 0644]
clang/test/Index/create-libclang-parsing-reproducer.c [new file with mode: 0644]
clang/tools/driver/CMakeLists.txt
clang/tools/driver/cc1gen_reproducer_main.cpp [new file with mode: 0644]
clang/tools/driver/driver.cpp