summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2016-12-19 16:50:43 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2016-12-19 16:50:43 +0000
commit7b182344845b9088e4b595d28b6f60744aa773c6 (patch)
tree222f600fe204b1c03ba01b416a1e1bceef283a1a /tools
parentb917c327ed880036a94aeb325aee20297a33702f (diff)
[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
Diffstat (limited to 'tools')
-rw-r--r--tools/libclang/CIndex.cpp4
-rw-r--r--tools/libclang/CIndexHigh.cpp3
2 files changed, 7 insertions, 0 deletions
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"