]> granicus.if.org Git - clang/commitdiff
[libclang] Revert part of r290025, "Remove the 'extern "C"' blocks from the implement...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 19 Dec 2016 16:50:43 +0000 (16:50 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 19 Dec 2016 16:50:43 +0000 (16:50 +0000)
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

tools/libclang/CIndex.cpp
tools/libclang/CIndexHigh.cpp

index bc5aa1f25370185a88da4e3a1ae7a9bd47b83a7b..82dccab8420cd2350466914e95797833f47fe7ca 100644 (file)
@@ -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);
 
index b659348a90cd18ea3599a481e038b22e083ad234..d4666c2288c94e853045294fa9b5f9cc0c5b70c3 100644 (file)
@@ -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"