forked from OSchip/llvm-project
[libclang] Move the check for errors in c-index-test before the TU gets disposed.
llvm-svn: 144514
This commit is contained in:
parent
c4a2cb34bb
commit
70480496c8
|
@ -709,6 +709,11 @@ static int perform_test_load(CXIndex Idx, CXTranslationUnit TU,
|
|||
PV(TU);
|
||||
|
||||
PrintDiagnostics(TU);
|
||||
if (checkForErrors(TU) != 0) {
|
||||
clang_disposeTranslationUnit(TU);
|
||||
return -1;
|
||||
}
|
||||
|
||||
clang_disposeTranslationUnit(TU);
|
||||
return 0;
|
||||
}
|
||||
|
@ -830,9 +835,6 @@ int perform_test_reparse_source(int argc, const char **argv, int trials,
|
|||
|
||||
result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV);
|
||||
|
||||
if (checkForErrors(TU) != 0)
|
||||
return -1;
|
||||
|
||||
free_remapped_files(unsaved_files, num_unsaved_files);
|
||||
clang_disposeIndex(Idx);
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue