Remove assert added in r201249.
authorDaniel Jasper <djasper@google.com>
Thu, 13 Feb 2014 14:24:14 +0000 (14:24 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 13 Feb 2014 14:24:14 +0000 (14:24 +0000)
This triggers on one of our internal tests.

Dmitri:
I do not understand this part of the codebase well enough to locate the
underlying cause easily. If the correct fix is not obvious, I can try to
debug the problem further or try to come up with reduced test case.

llvm-svn: 201329

clang/tools/libclang/CIndex.cpp

index 63acd0a..a74feab 100644 (file)
@@ -2826,8 +2826,12 @@ clang_parseTranslationUnit(CXIndex CIdx,
       CIdx, source_filename, command_line_args, num_command_line_args,
       unsaved_files, num_unsaved_files, options, &TU);
   (void)Result;
-  assert((TU && Result == CXError_Success) ||
-         (!TU && Result != CXError_Success));
+
+  // FIXME: This probably papers over a problem. If the result is not success,
+  // no TU should be set.
+  if (Result != CXError_Success)
+    return 0;
+
   return TU;
 }