Browse Source

[libclang] Remove the 'extern "C"' blocks from the implementation files.

These are unnecessary, the declarations already carry the 'extern C' property, and if there is mismatch
between declaration and definition then we will get linker errors via libclang.exports.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290025 91177308-0d34-0410-b5e6-96231b3b80d8
Argyrios Kyrtzidis 8 years ago
parent
commit
d9d5af2d99

+ 0 - 4
tools/libclang/ARCMigrate.cpp

@@ -32,8 +32,6 @@ struct Remap {
 // libClang public APIs.
 // libClang public APIs.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
-
 CXRemapping clang_getRemappings(const char *migrate_dir_path) {
 CXRemapping clang_getRemappings(const char *migrate_dir_path) {
 #ifndef CLANG_ENABLE_ARCMT
 #ifndef CLANG_ENABLE_ARCMT
   llvm::errs() << "error: feature not enabled in this build\n";
   llvm::errs() << "error: feature not enabled in this build\n";
@@ -138,5 +136,3 @@ void clang_remap_getFilenames(CXRemapping map, unsigned index,
 void clang_remap_dispose(CXRemapping map) {
 void clang_remap_dispose(CXRemapping map) {
   delete static_cast<Remap *>(map);
   delete static_cast<Remap *>(map);
 }
 }
-
-} // end: extern "C"

+ 0 - 43
tools/libclang/CIndex.cpp

@@ -3110,7 +3110,6 @@ struct RegisterFatalErrorHandler {
 
 
 static llvm::ManagedStatic<RegisterFatalErrorHandler> RegisterFatalErrorHandlerOnce;
 static llvm::ManagedStatic<RegisterFatalErrorHandler> RegisterFatalErrorHandlerOnce;
 
 
-extern "C" {
 CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
 CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
                           int displayDiagnostics) {
                           int displayDiagnostics) {
   // We use crash recovery to make some of our APIs more reliable, implicitly
   // We use crash recovery to make some of our APIs more reliable, implicitly
@@ -3968,13 +3967,10 @@ CXCursor clang_getTranslationUnitCursor(CXTranslationUnit TU) {
   return MakeCXCursor(CXXUnit->getASTContext().getTranslationUnitDecl(), TU);
   return MakeCXCursor(CXXUnit->getASTContext().getTranslationUnitDecl(), TU);
 }
 }
 
 
-} // end: extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // CXFile Operations.
 // CXFile Operations.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
 CXString clang_getFileName(CXFile SFile) {
 CXString clang_getFileName(CXFile SFile) {
   if (!SFile)
   if (!SFile)
     return cxstring::createNull();
     return cxstring::createNull();
@@ -4043,8 +4039,6 @@ int clang_File_isEqual(CXFile file1, CXFile file2) {
   return FEnt1->getUniqueID() == FEnt2->getUniqueID();
   return FEnt1->getUniqueID() == FEnt2->getUniqueID();
 }
 }
 
 
-} // end: extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // CXCursor Operations.
 // CXCursor Operations.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -4120,8 +4114,6 @@ static SourceLocation getLocationFromExpr(const Expr *E) {
   return E->getLocStart();
   return E->getLocStart();
 }
 }
 
 
-extern "C" {
-
 unsigned clang_visitChildren(CXCursor parent,
 unsigned clang_visitChildren(CXCursor parent,
                              CXCursorVisitor visitor,
                              CXCursorVisitor visitor,
                              CXClientData client_data) {
                              CXClientData client_data) {
@@ -5383,8 +5375,6 @@ CXSourceLocation clang_getCursorLocation(CXCursor C) {
   return cxloc::translateSourceLocation(getCursorContext(C), Loc);
   return cxloc::translateSourceLocation(getCursorContext(C), Loc);
 }
 }
 
 
-} // end extern "C"
-
 CXCursor cxcursor::getCursor(CXTranslationUnit TU, SourceLocation SLoc) {
 CXCursor cxcursor::getCursor(CXTranslationUnit TU, SourceLocation SLoc) {
   assert(TU);
   assert(TU);
 
 
@@ -5554,8 +5544,6 @@ static SourceRange getFullCursorExtent(CXCursor C, SourceManager &SrcMgr) {
   return getRawCursorExtent(C);
   return getRawCursorExtent(C);
 }
 }
 
 
-extern "C" {
-
 CXSourceRange clang_getCursorExtent(CXCursor C) {
 CXSourceRange clang_getCursorExtent(CXCursor C) {
   SourceRange R = getRawCursorExtent(C);
   SourceRange R = getRawCursorExtent(C);
   if (R.isInvalid())
   if (R.isInvalid())
@@ -6048,8 +6036,6 @@ void clang_executeOnThread(void (*fn)(void*), void *user_data,
   llvm::llvm_execute_on_thread(fn, user_data, stack_size);
   llvm::llvm_execute_on_thread(fn, user_data, stack_size);
 }
 }
 
 
-} // end: extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Token-based Operations.
 // Token-based Operations.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -6062,8 +6048,6 @@ void clang_executeOnThread(void (*fn)(void*), void *user_data,
  *   ptr_data: for identifiers and keywords, an IdentifierInfo*.
  *   ptr_data: for identifiers and keywords, an IdentifierInfo*.
  *   otherwise unused.
  *   otherwise unused.
  */
  */
-extern "C" {
-
 CXTokenKind clang_getTokenKind(CXToken CXTok) {
 CXTokenKind clang_getTokenKind(CXToken CXTok) {
   return static_cast<CXTokenKind>(CXTok.int_data[0]);
   return static_cast<CXTokenKind>(CXTok.int_data[0]);
 }
 }
@@ -6252,8 +6236,6 @@ void clang_disposeTokens(CXTranslationUnit TU,
   free(Tokens);
   free(Tokens);
 }
 }
 
 
-} // end: extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Token annotation APIs.
 // Token annotation APIs.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -6921,8 +6903,6 @@ static void clang_annotateTokensImpl(CXTranslationUnit TU, ASTUnit *CXXUnit,
   }
   }
 }
 }
 
 
-extern "C" {
-
 void clang_annotateTokens(CXTranslationUnit TU,
 void clang_annotateTokens(CXTranslationUnit TU,
                           CXToken *Tokens, unsigned NumTokens,
                           CXToken *Tokens, unsigned NumTokens,
                           CXCursor *Cursors) {
                           CXCursor *Cursors) {
@@ -6962,13 +6942,10 @@ void clang_annotateTokens(CXTranslationUnit TU,
   }
   }
 }
 }
 
 
-} // end: extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Operations for querying linkage of a cursor.
 // Operations for querying linkage of a cursor.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
 CXLinkageKind clang_getCursorLinkage(CXCursor cursor) {
 CXLinkageKind clang_getCursorLinkage(CXCursor cursor) {
   if (!clang_isDeclaration(cursor.kind))
   if (!clang_isDeclaration(cursor.kind))
     return CXLinkage_Invalid;
     return CXLinkage_Invalid;
@@ -6985,13 +6962,11 @@ CXLinkageKind clang_getCursorLinkage(CXCursor cursor) {
 
 
   return CXLinkage_Invalid;
   return CXLinkage_Invalid;
 }
 }
-} // end: extern "C"
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Operations for querying visibility of a cursor.
 // Operations for querying visibility of a cursor.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
 CXVisibilityKind clang_getCursorVisibility(CXCursor cursor) {
 CXVisibilityKind clang_getCursorVisibility(CXCursor cursor) {
   if (!clang_isDeclaration(cursor.kind))
   if (!clang_isDeclaration(cursor.kind))
     return CXVisibility_Invalid;
     return CXVisibility_Invalid;
@@ -7006,7 +6981,6 @@ CXVisibilityKind clang_getCursorVisibility(CXCursor cursor) {
 
 
   return CXVisibility_Invalid;
   return CXVisibility_Invalid;
 }
 }
-} // end: extern "C"
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Operations for querying language of a cursor.
 // Operations for querying language of a cursor.
@@ -7062,8 +7036,6 @@ static CXLanguageKind getDeclLanguage(const Decl *D) {
   return CXLanguage_C;
   return CXLanguage_C;
 }
 }
 
 
-extern "C" {
-
 static CXAvailabilityKind getCursorAvailabilityForDecl(const Decl *D) {
 static CXAvailabilityKind getCursorAvailabilityForDecl(const Decl *D) {
   if (isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->isDeleted())
   if (isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->isDeleted())
     return CXAvailability_NotAvailable;
     return CXAvailability_NotAvailable;
@@ -7533,14 +7505,10 @@ CXFile clang_Module_getTopLevelHeader(CXTranslationUnit TU,
   return nullptr;
   return nullptr;
 }
 }
 
 
-} // end: extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // C++ AST instrospection.
 // C++ AST instrospection.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
-
 unsigned clang_CXXConstructor_isDefaultConstructor(CXCursor C) {
 unsigned clang_CXXConstructor_isDefaultConstructor(CXCursor C) {
   if (!clang_isDeclaration(C.kind))
   if (!clang_isDeclaration(C.kind))
     return 0;
     return 0;
@@ -7641,13 +7609,11 @@ unsigned clang_CXXMethod_isVirtual(CXCursor C) {
       D ? dyn_cast_or_null<CXXMethodDecl>(D->getAsFunction()) : nullptr;
       D ? dyn_cast_or_null<CXXMethodDecl>(D->getAsFunction()) : nullptr;
   return (Method && Method->isVirtual()) ? 1 : 0;
   return (Method && Method->isVirtual()) ? 1 : 0;
 }
 }
-} // end: extern "C"
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Attribute introspection.
 // Attribute introspection.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
 CXType clang_getIBOutletCollectionType(CXCursor C) {
 CXType clang_getIBOutletCollectionType(CXCursor C) {
   if (C.kind != CXCursor_IBOutletCollectionAttr)
   if (C.kind != CXCursor_IBOutletCollectionAttr)
     return cxtype::MakeCXType(QualType(), cxcursor::getCursorTU(C));
     return cxtype::MakeCXType(QualType(), cxcursor::getCursorTU(C));
@@ -7657,7 +7623,6 @@ CXType clang_getIBOutletCollectionType(CXCursor C) {
   
   
   return cxtype::MakeCXType(A->getInterface(), cxcursor::getCursorTU(C));  
   return cxtype::MakeCXType(A->getInterface(), cxcursor::getCursorTU(C));  
 }
 }
-} // end: extern "C"
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Inspecting memory usage.
 // Inspecting memory usage.
@@ -7672,8 +7637,6 @@ static inline void createCXTUResourceUsageEntry(MemUsageEntries &entries,
   entries.push_back(entry);
   entries.push_back(entry);
 }
 }
 
 
-extern "C" {
-
 const char *clang_getTUResourceUsageName(CXTUResourceUsageKind kind) {
 const char *clang_getTUResourceUsageName(CXTUResourceUsageKind kind) {
   const char *str = "";
   const char *str = "";
   switch (kind) {
   switch (kind) {
@@ -7894,8 +7857,6 @@ void clang_disposeSourceRangeList(CXSourceRangeList *ranges) {
   }
   }
 }
 }
 
 
-} // end extern "C"
-
 void clang::PrintLibclangResourceUsage(CXTranslationUnit TU) {
 void clang::PrintLibclangResourceUsage(CXTranslationUnit TU) {
   CXTUResourceUsage Usage = clang_getCXTUResourceUsage(TU);
   CXTUResourceUsage Usage = clang_getCXTUResourceUsage(TU);
   for (unsigned I = 0; I != Usage.numEntries; ++I)
   for (unsigned I = 0; I != Usage.numEntries; ++I)
@@ -8058,14 +8019,10 @@ cxindex::checkForMacroInMacroDefinition(const MacroInfo *MI, SourceLocation Loc,
   return checkForMacroInMacroDefinition(MI, Tok, TU);
   return checkForMacroInMacroDefinition(MI, Tok, TU);
 }
 }
 
 
-extern "C" {
-
 CXString clang_getClangVersion() {
 CXString clang_getClangVersion() {
   return cxstring::createDup(getClangFullVersion());
   return cxstring::createDup(getClangFullVersion());
 }
 }
 
 
-} // end: extern "C"
-
 Logger &cxindex::Logger::operator<<(CXTranslationUnit TU) {
 Logger &cxindex::Logger::operator<<(CXTranslationUnit TU) {
   if (TU) {
   if (TU) {
     if (ASTUnit *Unit = cxtu::getASTUnit(TU)) {
     if (ASTUnit *Unit = cxtu::getASTUnit(TU)) {

+ 0 - 4
tools/libclang/CIndexCXX.cpp

@@ -20,8 +20,6 @@
 using namespace clang;
 using namespace clang;
 using namespace clang::cxcursor;
 using namespace clang::cxcursor;
 
 
-extern "C" {
-
 unsigned clang_isVirtualBase(CXCursor C) {
 unsigned clang_isVirtualBase(CXCursor C) {
   if (C.kind != CXCursor_CXXBaseSpecifier)
   if (C.kind != CXCursor_CXXBaseSpecifier)
     return 0;
     return 0;
@@ -123,5 +121,3 @@ CXCursor clang_getSpecializedCursorTemplate(CXCursor C) {
   
   
   return MakeCXCursor(Template, getCursorTU(C));
   return MakeCXCursor(Template, getCursorTU(C));
 }
 }
-  
-} // end extern "C"

+ 3 - 12
tools/libclang/CIndexCodeCompletion.cpp

@@ -53,8 +53,6 @@
 using namespace clang;
 using namespace clang;
 using namespace clang::cxindex;
 using namespace clang::cxindex;
 
 
-extern "C" {
-
 enum CXCompletionChunkKind
 enum CXCompletionChunkKind
 clang_getCompletionChunkKind(CXCompletionString completion_string,
 clang_getCompletionChunkKind(CXCompletionString completion_string,
                              unsigned chunk_number) {
                              unsigned chunk_number) {
@@ -346,8 +344,6 @@ AllocatedCXCodeCompleteResults::~AllocatedCXCodeCompleteResults() {
     fprintf(stderr, "--- %u completion results\n",
     fprintf(stderr, "--- %u completion results\n",
             --CodeCompletionResultObjects);
             --CodeCompletionResultObjects);
 }
 }
-  
-} // end extern "C"
 
 
 static unsigned long long getContextsForContextKind(
 static unsigned long long getContextsForContextKind(
                                           enum CodeCompletionContext::Kind kind, 
                                           enum CodeCompletionContext::Kind kind, 
@@ -794,7 +790,6 @@ clang_codeCompleteAt_Impl(CXTranslationUnit TU, const char *complete_filename,
   return Results;
   return Results;
 }
 }
 
 
-extern "C" {
 CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
 CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
                                             const char *complete_filename,
                                             const char *complete_filename,
                                             unsigned complete_line,
                                             unsigned complete_line,
@@ -916,8 +911,6 @@ CXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *ResultsIn) {
   return cxstring::createDup(Results->Selector);
   return cxstring::createDup(Results->Selector);
 }
 }
   
   
-} // end extern "C"
-
 /// \brief Simple utility function that appends a \p New string to the given
 /// \brief Simple utility function that appends a \p New string to the given
 /// \p Old string, using the \p Buffer for storage.
 /// \p Old string, using the \p Buffer for storage.
 ///
 ///
@@ -990,9 +983,7 @@ namespace {
   };
   };
 }
 }
 
 
-extern "C" {
-  void clang_sortCodeCompletionResults(CXCompletionResult *Results,
-                                       unsigned NumResults) {
-    std::stable_sort(Results, Results + NumResults, OrderCompletionResults());
-  }
+void clang_sortCodeCompletionResults(CXCompletionResult *Results,
+                                     unsigned NumResults) {
+  std::stable_sort(Results, Results + NumResults, OrderCompletionResults());
 }
 }

+ 0 - 4
tools/libclang/CIndexDiagnostic.cpp

@@ -205,8 +205,6 @@ CXDiagnosticSetImpl *cxdiag::lazyCreateDiags(CXTranslationUnit TU,
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // C Interface Routines
 // C Interface Routines
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-extern "C" {
-
 unsigned clang_getNumDiagnostics(CXTranslationUnit Unit) {
 unsigned clang_getNumDiagnostics(CXTranslationUnit Unit) {
   if (cxtu::isNotUsableTU(Unit)) {
   if (cxtu::isNotUsableTU(Unit)) {
     LOG_BAD_TU(Unit);
     LOG_BAD_TU(Unit);
@@ -477,5 +475,3 @@ unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet Diags) {
     return D->getNumDiagnostics();
     return D->getNumDiagnostics();
   return 0;
   return 0;
 }
 }
-
-} // end extern "C"

+ 0 - 4
tools/libclang/CIndexHigh.cpp

@@ -407,8 +407,6 @@ static bool findIncludesInFile(CXTranslationUnit TU, const FileEntry *File,
 // libclang public APIs.
 // libclang public APIs.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
-
 CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file,
 CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file,
                                     CXCursorAndRangeVisitor visitor) {
                                     CXCursorAndRangeVisitor visitor) {
   LogRef Log = Logger::make(__func__);
   LogRef Log = Logger::make(__func__);
@@ -534,5 +532,3 @@ CXResult clang_findIncludesInFileWithBlock(CXTranslationUnit TU,
   return clang_findIncludesInFile(TU, file, visitor);
   return clang_findIncludesInFile(TU, file, visitor);
 }
 }
 
 
-} // end: extern "C"
-

+ 0 - 2
tools/libclang/CIndexInclusionStack.cpp

@@ -68,7 +68,6 @@ static void getInclusions(const SrcMgr::SLocEntry &(SourceManager::*Getter)(unsi
 }
 }
 
 
 
 
-extern "C" {
 void clang_getInclusions(CXTranslationUnit TU, CXInclusionVisitor CB,
 void clang_getInclusions(CXTranslationUnit TU, CXInclusionVisitor CB,
                          CXClientData clientData) {
                          CXClientData clientData) {
   if (cxtu::isNotUsableTU(TU)) {
   if (cxtu::isNotUsableTU(TU)) {
@@ -96,4 +95,3 @@ void clang_getInclusions(CXTranslationUnit TU, CXInclusionVisitor CB,
     getInclusions(&SourceManager::getLocalSLocEntry, n, TU, CB, clientData);
     getInclusions(&SourceManager::getLocalSLocEntry, n, TU, CB, clientData);
 
 
 }
 }
-} // end extern C

+ 0 - 4
tools/libclang/CIndexUSRs.cpp

@@ -36,8 +36,6 @@ bool cxcursor::getDeclCursorUSR(const Decl *D, SmallVectorImpl<char> &Buf) {
   return generateUSRForDecl(D, Buf);
   return generateUSRForDecl(D, Buf);
 }
 }
 
 
-extern "C" {
-
 CXString clang_getCursorUSR(CXCursor C) {
 CXString clang_getCursorUSR(CXCursor C) {
   const CXCursorKind &K = clang_getCursorKind(C);
   const CXCursorKind &K = clang_getCursorKind(C);
 
 
@@ -140,5 +138,3 @@ CXString clang_constructUSR_ObjCProperty(const char *property,
   generateUSRForObjCProperty(property, /*isClassProp=*/false, OS);
   generateUSRForObjCProperty(property, /*isClassProp=*/false, OS);
   return cxstring::createDup(OS.str());
   return cxstring::createDup(OS.str());
 }
 }
-
-} // end extern "C"

+ 0 - 4
tools/libclang/CXComment.cpp

@@ -26,8 +26,6 @@ using namespace clang;
 using namespace clang::comments;
 using namespace clang::comments;
 using namespace clang::cxcomment;
 using namespace clang::cxcomment;
 
 
-extern "C" {
-
 CXComment clang_Cursor_getParsedComment(CXCursor C) {
 CXComment clang_Cursor_getParsedComment(CXCursor C) {
   using namespace clang::cxcursor;
   using namespace clang::cxcursor;
 
 
@@ -406,5 +404,3 @@ CXString clang_FullComment_getAsXML(CXComment CXC) {
   return cxstring::createDup(XML.str());
   return cxstring::createDup(XML.str());
 }
 }
 
 
-} // end extern "C"
-

+ 0 - 4
tools/libclang/CXCompilationDatabase.cpp

@@ -6,8 +6,6 @@
 using namespace clang;
 using namespace clang;
 using namespace clang::tooling;
 using namespace clang::tooling;
 
 
-extern "C" {
-
 // FIXME: do something more useful with the error message
 // FIXME: do something more useful with the error message
 CXCompilationDatabase
 CXCompilationDatabase
 clang_CompilationDatabase_fromDirectory(const char *BuildDir,
 clang_CompilationDatabase_fromDirectory(const char *BuildDir,
@@ -180,5 +178,3 @@ clang_CompileCommand_getMappedSourceContent(CXCompileCommand CCmd, unsigned I)
 
 
   return cxstring::createRef(Cmd->MappedSources[I].second.c_str());
   return cxstring::createRef(Cmd->MappedSources[I].second.c_str());
 }
 }
-
-} // end: extern "C"

+ 0 - 9
tools/libclang/CXCursor.cpp

@@ -1104,8 +1104,6 @@ bool cxcursor::isFirstInDeclGroup(CXCursor C) {
 // libclang CXCursor APIs
 // libclang CXCursor APIs
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
-
 int clang_Cursor_isNull(CXCursor cursor) {
 int clang_Cursor_isNull(CXCursor cursor) {
   return clang_equalCursors(cursor, clang_getNullCursor());
   return clang_equalCursors(cursor, clang_getNullCursor());
 }
 }
@@ -1295,8 +1293,6 @@ unsigned long long clang_Cursor_getTemplateArgumentUnsignedValue(CXCursor C,
   return TA.getAsIntegral().getZExtValue();
   return TA.getAsIntegral().getZExtValue();
 }
 }
 
 
-} // end: extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // CXCursorSet.
 // CXCursorSet.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -1330,7 +1326,6 @@ public:
 };
 };
 }
 }
 
 
-extern "C" {
 CXCursorSet clang_createCXCursorSet() {
 CXCursorSet clang_createCXCursorSet() {
   return packCXCursorSet(new CXCursorSet_Impl());
   return packCXCursorSet(new CXCursorSet_Impl());
 }
 }
@@ -1393,7 +1388,6 @@ CXCompletionString clang_getCursorCompletionString(CXCursor cursor) {
   }
   }
   return nullptr;
   return nullptr;
 }
 }
-} // end: extern C.
 
 
 namespace {
 namespace {
   struct OverridenCursorsPool {
   struct OverridenCursorsPool {
@@ -1418,7 +1412,6 @@ void cxcursor::disposeOverridenCXCursorsPool(void *pool) {
   delete static_cast<OverridenCursorsPool*>(pool);
   delete static_cast<OverridenCursorsPool*>(pool);
 }
 }
  
  
-extern "C" {
 void clang_getOverriddenCursors(CXCursor cursor,
 void clang_getOverriddenCursors(CXCursor cursor,
                                 CXCursor **overridden,
                                 CXCursor **overridden,
                                 unsigned *num_overridden) {
                                 unsigned *num_overridden) {
@@ -1540,5 +1533,3 @@ CXType clang_Cursor_getReceiverType(CXCursor C) {
 
 
   return cxtype::MakeCXType(QualType(), TU);
   return cxtype::MakeCXType(QualType(), TU);
 }
 }
-
-} // end: extern "C"

+ 0 - 2
tools/libclang/CXLoadedDiagnostic.cpp

@@ -387,11 +387,9 @@ std::error_code DiagLoader::visitDiagnosticRecord(
   return std::error_code();
   return std::error_code();
 }
 }
 
 
-extern "C" {
 CXDiagnosticSet clang_loadDiagnostics(const char *file,
 CXDiagnosticSet clang_loadDiagnostics(const char *file,
                                       enum CXLoadDiag_Error *error,
                                       enum CXLoadDiag_Error *error,
                                       CXString *errorString) {
                                       CXString *errorString) {
   DiagLoader L(error, errorString);
   DiagLoader L(error, errorString);
   return L.load(file);
   return L.load(file);
 }
 }
-} // end extern 'C'.

+ 0 - 12
tools/libclang/CXSourceLocation.cpp

@@ -38,8 +38,6 @@ static bool isASTUnitSourceLocation(const CXSourceLocation &L) {
 // Basic construction and comparison of CXSourceLocations and CXSourceRanges.
 // Basic construction and comparison of CXSourceLocations and CXSourceRanges.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
-  
 CXSourceLocation clang_getNullLocation() {
 CXSourceLocation clang_getNullLocation() {
   CXSourceLocation Result = { { nullptr, nullptr }, 0 };
   CXSourceLocation Result = { { nullptr, nullptr }, 0 };
   return Result;
   return Result;
@@ -110,14 +108,10 @@ CXSourceLocation clang_getRangeEnd(CXSourceRange range) {
   return Result;
   return Result;
 }
 }
 
 
-} // end extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //  Getting CXSourceLocations and CXSourceRanges from a translation unit.
 //  Getting CXSourceLocations and CXSourceRanges from a translation unit.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
-  
 CXSourceLocation clang_getLocation(CXTranslationUnit TU,
 CXSourceLocation clang_getLocation(CXTranslationUnit TU,
                                    CXFile file,
                                    CXFile file,
                                    unsigned line,
                                    unsigned line,
@@ -174,8 +168,6 @@ CXSourceLocation clang_getLocationForOffset(CXTranslationUnit TU,
   return cxloc::translateSourceLocation(CXXUnit->getASTContext(), SLoc);
   return cxloc::translateSourceLocation(CXXUnit->getASTContext(), SLoc);
 }
 }
 
 
-} // end extern "C"
-
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Routines for expanding and manipulating CXSourceLocations, regardless
 // Routines for expanding and manipulating CXSourceLocations, regardless
 // of their origin.
 // of their origin.
@@ -205,8 +197,6 @@ static void createNullLocation(CXString *filename, unsigned *line,
     *offset = 0;
     *offset = 0;
 }
 }
 
 
-extern "C" {
-
 int clang_Location_isInSystemHeader(CXSourceLocation location) {
 int clang_Location_isInSystemHeader(CXSourceLocation location) {
   const SourceLocation Loc =
   const SourceLocation Loc =
     SourceLocation::getFromRawEncoding(location.int_data);
     SourceLocation::getFromRawEncoding(location.int_data);
@@ -382,5 +372,3 @@ void clang_getFileLocation(CXSourceLocation location,
   if (offset)
   if (offset)
     *offset = FileOffset;
     *offset = FileOffset;
 }
 }
-
-} // end extern "C"

+ 0 - 3
tools/libclang/CXString.cpp

@@ -161,7 +161,6 @@ bool isManagedByPool(CXString str) {
 // libClang public APIs.
 // libClang public APIs.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
 const char *clang_getCString(CXString string) {
 const char *clang_getCString(CXString string) {
   if (string.private_flags == (unsigned) CXS_StringBuf) {
   if (string.private_flags == (unsigned) CXS_StringBuf) {
     return static_cast<const cxstring::CXStringBuf *>(string.data)->Data.data();
     return static_cast<const cxstring::CXStringBuf *>(string.data)->Data.data();
@@ -191,5 +190,3 @@ void clang_disposeStringSet(CXStringSet *set) {
   delete set;
   delete set;
 }
 }
 
 
-} // end: extern "C"
-

+ 0 - 4
tools/libclang/CXType.cpp

@@ -182,8 +182,6 @@ FindTemplateArgumentTypeAt(ArrayRef<TemplateArgument> TA, unsigned index) {
   return None;
   return None;
 }
 }
 
 
-extern "C" {
-
 CXType clang_getCursorType(CXCursor C) {
 CXType clang_getCursorType(CXCursor C) {
   using namespace cxcursor;
   using namespace cxcursor;
 
 
@@ -1038,5 +1036,3 @@ CXType clang_Type_getNamedType(CXType CT){
 
 
   return MakeCXType(QualType(), GetTU(CT));
   return MakeCXType(QualType(), GetTU(CT));
 }
 }
-
-} // end: extern "C"

+ 0 - 4
tools/libclang/Indexing.cpp

@@ -687,8 +687,6 @@ static CXErrorCode clang_indexTranslationUnit_Impl(
 // libclang public APIs.
 // libclang public APIs.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
-extern "C" {
-
 int clang_index_isEntityObjCContainerKind(CXIdxEntityKind K) {
 int clang_index_isEntityObjCContainerKind(CXIdxEntityKind K) {
   return CXIdxEntity_ObjCClass <= K && K <= CXIdxEntity_ObjCCategory;
   return CXIdxEntity_ObjCClass <= K && K <= CXIdxEntity_ObjCCategory;
 }
 }
@@ -978,5 +976,3 @@ CXSourceLocation clang_indexLoc_getCXSourceLocation(CXIdxLoc location) {
   return cxloc::translateSourceLocation(DataConsumer.getASTContext(), Loc);
   return cxloc::translateSourceLocation(DataConsumer.getASTContext(), Loc);
 }
 }
 
 
-} // end: extern "C"
-