From 9049cf6cb468c856888e88251dab659955fa767e Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 12 Oct 2011 07:07:33 +0000 Subject: [PATCH] [libclang] Make MakeCXTranslationUnit usable outside CIndex.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141769 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/libclang/CIndex.cpp | 3 ++- tools/libclang/CXTranslationUnit.h | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index f36ee924af..71d9462a01 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -51,8 +51,9 @@ using namespace clang; using namespace clang::cxcursor; using namespace clang::cxstring; +using namespace clang::cxtu; -static CXTranslationUnit MakeCXTranslationUnit(ASTUnit *TU) { +CXTranslationUnit cxtu::MakeCXTranslationUnit(ASTUnit *TU) { if (!TU) return 0; CXTranslationUnit D = new CXTranslationUnitImpl(); diff --git a/tools/libclang/CXTranslationUnit.h b/tools/libclang/CXTranslationUnit.h index 6df85b7d4d..2b8f977539 100644 --- a/tools/libclang/CXTranslationUnit.h +++ b/tools/libclang/CXTranslationUnit.h @@ -21,4 +21,13 @@ struct CXTranslationUnitImpl { }; } +namespace clang { + class ASTUnit; + +namespace cxtu { + +CXTranslationUnitImpl *MakeCXTranslationUnit(ASTUnit *TU); + +}} // end namespace clang::cxtu + #endif