From: NAKAMURA Takumi Date: Mon, 19 Dec 2016 16:50:43 +0000 (+0000) Subject: [libclang] Revert part of r290025, "Remove the 'extern "C"' blocks from the implement... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b182344845b9088e4b595d28b6f60744aa773c6;p=clang [libclang] Revert part of r290025, "Remove the 'extern "C"' blocks from the implementation files." mingw32-ld complains missing symbols in exports, Cannot export clang_findIncludesInFileWithBlock: symbol not defined Cannot export clang_findReferencesInFileWithBlock: symbol not defined Cannot export clang_visitChildrenWithBlock: symbol not defined They are excluded conditionally in header along has_blocks. We should do either; 1. Exclude also function bodies conditionally, and introduce "optional" exporter. 2. Give dummy function bodies for them. 3. Implement functions w/o blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290113 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index bc5aa1f253..82dccab842 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -4120,6 +4120,8 @@ static SourceLocation getLocationFromExpr(const Expr *E) { return E->getLocStart(); } +extern "C" { + unsigned clang_visitChildren(CXCursor parent, CXCursorVisitor visitor, CXClientData client_data) { @@ -5383,6 +5385,8 @@ CXSourceLocation clang_getCursorLocation(CXCursor C) { return cxloc::translateSourceLocation(getCursorContext(C), Loc); } +} // end extern "C" + CXCursor cxcursor::getCursor(CXTranslationUnit TU, SourceLocation SLoc) { assert(TU); diff --git a/tools/libclang/CIndexHigh.cpp b/tools/libclang/CIndexHigh.cpp index b659348a90..d4666c2288 100644 --- a/tools/libclang/CIndexHigh.cpp +++ b/tools/libclang/CIndexHigh.cpp @@ -407,6 +407,8 @@ static bool findIncludesInFile(CXTranslationUnit TU, const FileEntry *File, // libclang public APIs. //===----------------------------------------------------------------------===// +extern "C" { + CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor) { LogRef Log = Logger::make(__func__); @@ -532,3 +534,4 @@ CXResult clang_findIncludesInFileWithBlock(CXTranslationUnit TU, return clang_findIncludesInFile(TU, file, visitor); } +} // end: extern "C"