Updated to Clang 3.5a.
Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
diff --git a/tools/libclang/CXTranslationUnit.h b/tools/libclang/CXTranslationUnit.h
index c0014c0..13183be 100644
--- a/tools/libclang/CXTranslationUnit.h
+++ b/tools/libclang/CXTranslationUnit.h
@@ -14,8 +14,9 @@
#ifndef LLVM_CLANG_CXTRANSLATIONUNIT_H
#define LLVM_CLANG_CXTRANSLATIONUNIT_H
-#include "clang-c/Index.h"
+#include "CLog.h"
#include "CXString.h"
+#include "clang-c/Index.h"
namespace clang {
class ASTUnit;
@@ -45,6 +46,21 @@
return TU->TheASTUnit;
}
+/// \returns true if the ASTUnit has a diagnostic about the AST file being
+/// corrupted.
+bool isASTReadError(ASTUnit *AU);
+
+static inline bool isNotUsableTU(CXTranslationUnit TU) {
+ return !TU;
+}
+
+#define LOG_BAD_TU(TU) \
+ do { \
+ LOG_FUNC_SECTION { \
+ *Log << "called with a bad TU: " << TU; \
+ } \
+ } while(false)
+
class CXTUOwner {
CXTranslationUnitImpl *TU;