[libclang] CompilationDatabase naming and comment fixes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159682 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 79a3c57..e16be7d 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -2415,7 +2415,7 @@
   memcpy(tmp, database, len+1);
   buildDir = dirname(tmp);
 
-  db = clang_tooling_CompilationDatabase_fromDirectory(buildDir, &ec);
+  db = clang_CompilationDatabase_fromDirectory(buildDir, &ec);
 
   if (db) {
 
@@ -2427,7 +2427,7 @@
 
     for (i=0; i<argc && errorCode==0; ) {
       if (strcmp(argv[i],"lookup")==0){
-        CCmds = clang_tooling_CompilationDatabase_getCompileCommands(db, argv[i+1]);
+        CCmds = clang_CompilationDatabase_getCompileCommands(db, argv[i+1]);
 
         if (!CCmds) {
           printf("file %s not found in compilation db\n", argv[i+1]);
@@ -2435,7 +2435,7 @@
           break;
         }
 
-        numCmds = clang_tooling_CompileCommands_getSize(CCmds);
+        numCmds = clang_CompileCommands_getSize(CCmds);
 
         if (numCmds==0) {
           fprintf(stderr, "should not get an empty compileCommand set for file"
@@ -2445,29 +2445,29 @@
         }
 
         for (j=0; j<numCmds; ++j) {
-          CCmd = clang_tooling_CompileCommands_getCommand(CCmds, j);
+          CCmd = clang_CompileCommands_getCommand(CCmds, j);
 
-          wd = clang_tooling_CompileCommand_getDirectory(CCmd);
+          wd = clang_CompileCommand_getDirectory(CCmd);
           printf("workdir:'%s'", clang_getCString(wd));
           clang_disposeString(wd);
 
           printf(" cmdline:'");
-          numArgs = clang_tooling_CompileCommand_getNumArgs(CCmd);
+          numArgs = clang_CompileCommand_getNumArgs(CCmd);
           for (a=0; a<numArgs; ++a) {
             if (a) printf(" ");
-            arg = clang_tooling_CompileCommand_getArg(CCmd, a);
+            arg = clang_CompileCommand_getArg(CCmd, a);
             printf("%s", clang_getCString(arg));
             clang_disposeString(arg);
           }
           printf("'\n");
         }
 
-        clang_tooling_CompileCommands_dispose(CCmds);
+        clang_CompileCommands_dispose(CCmds);
 
         i += 2;
       }
     }
-    clang_tooling_CompilationDatabase_dispose(db);
+    clang_CompilationDatabase_dispose(db);
   } else {
     printf("database loading failed with error code %d.\n", ec);
     errorCode = -1;
diff --git a/tools/libclang/CXCompilationDatabase.cpp b/tools/libclang/CXCompilationDatabase.cpp
index a537c9d..7bd319a 100644
--- a/tools/libclang/CXCompilationDatabase.cpp
+++ b/tools/libclang/CXCompilationDatabase.cpp
@@ -10,9 +10,8 @@
 
 // FIXME: do something more usefull with the error message
 CXCompilationDatabase
-clang_tooling_CompilationDatabase_fromDirectory(
-  const char *BuildDir,
-  CXCompilationDatabase_Error *ErrorCode)
+clang_CompilationDatabase_fromDirectory(const char *BuildDir,
+                                        CXCompilationDatabase_Error *ErrorCode)
 {
   std::string ErrorMsg;
   CXCompilationDatabase_Error Err = CXCompilationDatabase_NoError;
@@ -32,7 +31,7 @@
 }
 
 void
-clang_tooling_CompilationDatabase_dispose(CXCompilationDatabase CDb)
+clang_CompilationDatabase_dispose(CXCompilationDatabase CDb)
 {
   delete static_cast<CompilationDatabase *>(CDb);
 }
@@ -47,8 +46,8 @@
 };
 
 CXCompileCommands
-clang_tooling_CompilationDatabase_getCompileCommands(CXCompilationDatabase CDb,
-                                 const char *CompleteFileName)
+clang_CompilationDatabase_getCompileCommands(CXCompilationDatabase CDb,
+                                             const char *CompleteFileName)
 {
   if (CompilationDatabase *db = static_cast<CompilationDatabase *>(CDb)) {
     const std::vector<CompileCommand>
@@ -61,13 +60,13 @@
 }
 
 void
-clang_tooling_CompileCommands_dispose(CXCompileCommands Cmds)
+clang_CompileCommands_dispose(CXCompileCommands Cmds)
 {
   delete static_cast<AllocatedCXCompileCommands *>(Cmds);
 }
 
 unsigned
-clang_tooling_CompileCommands_getSize(CXCompileCommands Cmds)
+clang_CompileCommands_getSize(CXCompileCommands Cmds)
 {
   if (!Cmds)
     return 0;
@@ -79,7 +78,7 @@
 }
 
 CXCompileCommand
-clang_tooling_CompileCommands_getCommand(CXCompileCommands Cmds, unsigned I)
+clang_CompileCommands_getCommand(CXCompileCommands Cmds, unsigned I)
 {
   if (!Cmds)
     return 0;
@@ -94,7 +93,7 @@
 }
 
 CXString
-clang_tooling_CompileCommand_getDirectory(CXCompileCommand CCmd)
+clang_CompileCommand_getDirectory(CXCompileCommand CCmd)
 {
   if (!CCmd)
     return createCXString((const char*)NULL);
@@ -104,7 +103,7 @@
 }
 
 unsigned
-clang_tooling_CompileCommand_getNumArgs(CXCompileCommand CCmd)
+clang_CompileCommand_getNumArgs(CXCompileCommand CCmd)
 {
   if (!CCmd)
     return 0;
@@ -113,7 +112,7 @@
 }
 
 CXString
-clang_tooling_CompileCommand_getArg(CXCompileCommand CCmd, unsigned Arg)
+clang_CompileCommand_getArg(CXCompileCommand CCmd, unsigned Arg)
 {
   if (!CCmd)
     return createCXString((const char*)NULL);
diff --git a/tools/libclang/libclang.exports b/tools/libclang/libclang.exports
index 3775ce1..14ded19 100644
--- a/tools/libclang/libclang.exports
+++ b/tools/libclang/libclang.exports
@@ -206,14 +206,14 @@
 clang_sortCodeCompletionResults
 clang_toggleCrashRecovery
 clang_tokenize
-clang_tooling_CompilationDatabase_fromDirectory
-clang_tooling_CompilationDatabase_dispose
-clang_tooling_CompilationDatabase_getCompileCommands
-clang_tooling_CompileCommands_dispose
-clang_tooling_CompileCommands_getSize
-clang_tooling_CompileCommands_getCommand
-clang_tooling_CompileCommand_getDirectory
-clang_tooling_CompileCommand_getNumArgs
-clang_tooling_CompileCommand_getArg
+clang_CompilationDatabase_fromDirectory
+clang_CompilationDatabase_dispose
+clang_CompilationDatabase_getCompileCommands
+clang_CompileCommands_dispose
+clang_CompileCommands_getSize
+clang_CompileCommands_getCommand
+clang_CompileCommand_getDirectory
+clang_CompileCommand_getNumArgs
+clang_CompileCommand_getArg
 clang_visitChildren
 clang_visitChildrenWithBlock