aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-11 16:05:00 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-11 16:05:00 +0000
commit900ab95e12bb7483971640a91075699eec391804 (patch)
tree7c665d86bcfa0926f78ebe6f0ddb5149f0db9035 /tools/c-index-test
parent50d2b268d7a49719fe9dae89195ff809c4572dbf (diff)
[libclang] Improve AST serialization done by ASTUnit::Save().
The ASTUnit needs to initialize an ASTWriter at the beginning of parsing to fully handle serialization of a translation unit that imports modules. Do this by introducing an option to enable it, which corresponds to CXTranslationUnit_ForSerialization on the C API side. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test')
-rw-r--r--tools/c-index-test/c-index-test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index c073b80698..9424d43db1 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -2383,6 +2383,9 @@ static CXIdxClientFile index_importedASTFile(CXClientData client_data,
printf(" | name: \"%s\"", clang_getCString(name));
printf(" | isImplicit: %d\n", info->isImplicit);
clang_disposeString(name);
+ } else {
+ // PCH file, the rest are not relevant.
+ printf("\n");
}
return (CXIdxClientFile)info->file;
@@ -3055,7 +3058,8 @@ int write_pch_file(const char *filename, int argc, const char *argv[]) {
argc - num_unsaved_files,
unsaved_files,
num_unsaved_files,
- CXTranslationUnit_Incomplete);
+ CXTranslationUnit_Incomplete |
+ CXTranslationUnit_ForSerialization);
if (!TU) {
fprintf(stderr, "Unable to load translation unit!\n");
free_remapped_files(unsaved_files, num_unsaved_files);