diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-12-04 21:56:36 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-12-04 21:56:36 +0000 |
commit | 08615796109fc3a0cc1403803b0d1bab8e6e8828 (patch) | |
tree | 2fcc732a10de46aad6d63114f7d9a20069d0d39b /clang/tools/c-index-test/c-index-test.c | |
parent | 7c2cf5c5cca5456f3d1ba3fcfc7f2ad414317b8e (diff) | |
download | bcm5719-llvm-08615796109fc3a0cc1403803b0d1bab8e6e8828.tar.gz bcm5719-llvm-08615796109fc3a0cc1403803b0d1bab8e6e8828.zip |
[libclang] Record parsing invocation to a temporary file when requested
by client
This patch extends libclang by allowing it to record parsing operations to a
temporary JSON file. The file is deleted after parsing succeeds. When a crash
happens during parsing, the file is preserved and the client will be able to use
it to generate a reproducer for the crash.
These files are not emitted by default, and the client has to specify the
invocation emission path first.
rdar://35322543
Differential Revision: https://reviews.llvm.org/D40527
llvm-svn: 319702
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r-- | clang/tools/c-index-test/c-index-test.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c index a11e03c846e..6cb67e10306 100644 --- a/clang/tools/c-index-test/c-index-test.c +++ b/clang/tools/c-index-test/c-index-test.c @@ -1747,11 +1747,15 @@ int perform_test_load_source(int argc, const char **argv, int result; unsigned Repeats = 0; unsigned I; + const char *InvocationPath; Idx = clang_createIndex(/* excludeDeclsFromPCH */ (!strcmp(filter, "local") || !strcmp(filter, "local-display"))? 1 : 0, /* displayDiagnostics=*/1); + InvocationPath = getenv("CINDEXTEST_INVOCATION_EMISSION_PATH"); + if (InvocationPath) + clang_CXIndex_setInvocationEmissionPathOption(Idx, InvocationPath); if ((CommentSchemaFile = parse_comments_schema(argc, argv))) { argc--; |