summaryrefslogtreecommitdiffstats
path: root/clang/tools/driver/driver.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2018-04-07 00:03:27 +0000
committerAlex Lorenz <arphaman@gmail.com>2018-04-07 00:03:27 +0000
commit045c514fb42515df05eb9bea3cac6a831da05ce7 (patch)
tree7ed70c01f354836f52f3e177bcc5d7ec6509d7b4 /clang/tools/driver/driver.cpp
parent077b6d586b2a3e9c995823d2081d9837ac378215 (diff)
downloadbcm5719-llvm-045c514fb42515df05eb9bea3cac6a831da05ce7.tar.gz
bcm5719-llvm-045c514fb42515df05eb9bea3cac6a831da05ce7.zip
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
Diffstat (limited to 'clang/tools/driver/driver.cpp')
-rw-r--r--clang/tools/driver/driver.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index 72d56a72873..32cb1b45af1 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -205,6 +205,8 @@ extern int cc1_main(ArrayRef<const char *> Argv, const char *Argv0,
void *MainAddr);
extern int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0,
void *MainAddr);
+extern int cc1gen_reproducer_main(ArrayRef<const char *> Argv,
+ const char *Argv0, void *MainAddr);
static void insertTargetAndModeArgs(const ParsedClangName &NameParts,
SmallVectorImpl<const char *> &ArgVector,
@@ -310,6 +312,8 @@ static int ExecuteCC1Tool(ArrayRef<const char *> argv, StringRef Tool) {
return cc1_main(argv.slice(2), argv[0], GetExecutablePathVP);
if (Tool == "as")
return cc1as_main(argv.slice(2), argv[0], GetExecutablePathVP);
+ if (Tool == "gen-reproducer")
+ return cc1gen_reproducer_main(argv.slice(2), argv[0], GetExecutablePathVP);
// Reject unknown tools.
llvm::errs() << "error: unknown integrated tool '" << Tool << "'. "
OpenPOWER on IntegriCloud