This patch is a follow up to the previous work that recorded Libclang invocations into temporary files: https://reviews.llvm.org/D40527.
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 in the reproducers to stdout using JSON. It also injects additional Libclang-specific information about the reproducer to the reproducer's .sh files.
Thanks for taking a look!