Recommit r329442: Generate Libclang invocation reproducers using a new
authorAlex Lorenz <arphaman@gmail.com>
Sat, 7 Apr 2018 00:03:27 +0000 (00:03 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Sat, 7 Apr 2018 00:03:27 +0000 (00:03 +0000)
commit045c514fb42515df05eb9bea3cac6a831da05ce7
tree7ed70c01f354836f52f3e177bcc5d7ec6509d7b4
parent077b6d586b2a3e9c995823d2081d9837ac378215
Recommit r329442: Generate Libclang invocation reproducers using a new
-cc1gen-reproducer driver option

The recommit fixes:
- An MSAN failure (CCPrintOptions wasn't initialized in the Driver)
- Ensures that the strings in the libclang invocation files are escaped

Original message:

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: 329465
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
clang/tools/libclang/CIndexer.cpp