[cfe-commits] r111448 - /cfe/trunk/tools/c-index-test/c-index-test.c

Daniel Dunbar daniel at zuster.org
Wed Aug 18 16:09:16 PDT 2010


Author: ddunbar
Date: Wed Aug 18 18:09:16 2010
New Revision: 111448

URL: http://llvm.org/viewvc/llvm-project?rev=111448&view=rev
Log:
c-index-test: Change -test-load-source-repase to only use remapped files for the
reparse, to allow testing distinct inputs.

Modified:
    cfe/trunk/tools/c-index-test/c-index-test.c

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=111448&r1=111447&r2=111448&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Wed Aug 18 18:09:16 2010
@@ -627,12 +627,12 @@
     return -1;
   }
   
+  /* Load the initial translation unit -- we do this without honoring remapped
+   * files, so that we have a way to test results after changing the source. */
   TU = clang_parseTranslationUnit(Idx, 0,
                                   argv + num_unsaved_files,
                                   argc - num_unsaved_files,
-                                  unsaved_files,
-                                  num_unsaved_files,
-                                  getDefaultParsingOptions());
+                                  0, 0, getDefaultParsingOptions());
   if (!TU) {
     fprintf(stderr, "Unable to load translation unit!\n");
     free_remapped_files(unsaved_files, num_unsaved_files);
@@ -643,6 +643,7 @@
   for (trial = 0; trial < trials; ++trial) {
     if (clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
                                      clang_defaultReparseOptions(TU))) {
+      fprintf(stderr, "Unable to reparse translation unit!\n");
       clang_disposeTranslationUnit(TU);
       free_remapped_files(unsaved_files, num_unsaved_files);
       clang_disposeIndex(Idx);





More information about the cfe-commits mailing list