diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-26 08:01:41 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-26 08:01:41 +0000 |
commit | 4cdfcae75d7d9eddef079ceff7e6f53a35a89948 (patch) | |
tree | a593c66584b28fa9d4272118966b92bfde395559 /clang/tools/c-index-test | |
parent | 8f7180b11e024406e50ed53e27c95af461e6ec4d (diff) | |
download | bcm5719-llvm-4cdfcae75d7d9eddef079ceff7e6f53a35a89948.tar.gz bcm5719-llvm-4cdfcae75d7d9eddef079ceff7e6f53a35a89948.zip |
Don't map a file:line:col triplet that is inside the preamble range to
a "loaded" location of the precompiled preamble.
Instead, handle specially locations of preprocessed entities:
-When looking up for preprocessed entities, map main file locations inside the
preamble range to a preamble loaded location.
-When getting the source range of a preprocessing cursor, map preamble loaded
locations back to main file locations.
Fixes rdar://10175093 & http://llvm.org/PR10999
llvm-svn: 140519
Diffstat (limited to 'clang/tools/c-index-test')
-rw-r--r-- | clang/tools/c-index-test/c-index-test.c | 11 |
1 files changed, 11 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 6b72413d76f..33044e3da79 100644 --- a/clang/tools/c-index-test/c-index-test.c +++ b/clang/tools/c-index-test/c-index-test.c @@ -1405,6 +1405,17 @@ int perform_token_annotation(int argc, const char **argv) { } errorCode = 0; + if (getenv("CINDEXTEST_EDITING")) { + for (i = 0; i < 5; ++i) { + if (clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files, + clang_defaultReparseOptions(TU))) { + fprintf(stderr, "Unable to reparse translation unit!\n"); + errorCode = -1; + goto teardown; + } + } + } + file = clang_getFile(TU, filename); if (!file) { fprintf(stderr, "file %s is not in this translation unit\n", filename); |