[arcmt] Move the remapping functions to clang-c/Index.h and change 'arcmt_' prefix to 'clang_'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134916 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/ARCMigrate.cpp b/tools/libclang/ARCMigrate.cpp
index cd0d8bb..39c7d84 100644
--- a/tools/libclang/ARCMigrate.cpp
+++ b/tools/libclang/ARCMigrate.cpp
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang-c/ARCMigrate.h"
+#include "clang-c/Index.h"
 
 #include "CXString.h"
 #include "clang/ARCMigrate/ARCMT.h"
@@ -35,12 +35,12 @@
 
 extern "C" {
 
-CMTRemap arcmt_getRemappings(const char *migrate_dir_path) {
+CXRemapping clang_getRemappings(const char *migrate_dir_path) {
   bool Logging = ::getenv("LIBCLANG_LOGGING");
 
   if (!migrate_dir_path) {
     if (Logging)
-      llvm::errs() << "arcmt_getRemappings was called with NULL parameter\n";
+      llvm::errs() << "clang_getRemappings was called with NULL parameter\n";
     return 0;
   }
 
@@ -48,7 +48,7 @@
   llvm::sys::fs::exists(migrate_dir_path, exists);
   if (!exists) {
     if (Logging) {
-      llvm::errs() << "Error by arcmt_getRemappings(\"" << migrate_dir_path
+      llvm::errs() << "Error by clang_getRemappings(\"" << migrate_dir_path
                    << "\")\n";
       llvm::errs() << "\"" << migrate_dir_path << "\" does not exist\n";
     }
@@ -62,7 +62,7 @@
 
   if (err) {
     if (Logging) {
-      llvm::errs() << "Error by arcmt_getRemappings(\"" << migrate_dir_path
+      llvm::errs() << "Error by clang_getRemappings(\"" << migrate_dir_path
                    << "\")\n";
       for (TextDiagnosticBuffer::const_iterator
              I = diagBuffer.err_begin(), E = diagBuffer.err_end(); I != E; ++I)
@@ -74,22 +74,24 @@
   return remap.take();
 }
 
-unsigned arcmt_remap_getNumFiles(CMTRemap map) {
+unsigned clang_remap_getNumFiles(CXRemapping map) {
   return static_cast<Remap *>(map)->Vec.size();
   
 }
 
-CXString arcmt_remap_getOriginalFile(CMTRemap map, unsigned index) {
-  return cxstring::createCXString(static_cast<Remap *>(map)->Vec[index].first,
+void clang_remap_getFilenames(CXRemapping map, unsigned index,
+                              CXString *original, CXString *transformed) {
+  if (original)
+    *original = cxstring::createCXString(
+                                    static_cast<Remap *>(map)->Vec[index].first,
+                                        /*DupString =*/ true);
+  if (transformed)
+    *transformed = cxstring::createCXString(
+                                   static_cast<Remap *>(map)->Vec[index].second,
                                   /*DupString =*/ true);
 }
 
-CXString arcmt_remap_getTransformedFile(CMTRemap map, unsigned index) {
-  return cxstring::createCXString(static_cast<Remap *>(map)->Vec[index].second,
-                                  /*DupString =*/ true);
-}
-
-void arcmt_remap_dispose(CMTRemap map) {
+void clang_remap_dispose(CXRemapping map) {
   delete static_cast<Remap *>(map);
 }
 
diff --git a/tools/libclang/libclang.darwin.exports b/tools/libclang/libclang.darwin.exports
index a8b466e..bfc5be9 100644
--- a/tools/libclang/libclang.darwin.exports
+++ b/tools/libclang/libclang.darwin.exports
@@ -137,8 +137,7 @@
 _clang_tokenize
 _clang_visitChildren
 _clang_visitChildrenWithBlock
-_arcmt_getRemappings
-_arcmt_remap_getNumFiles
-_arcmt_remap_getOriginalFile
-_arcmt_remap_getTransformedFile
-_arcmt_remap_dispose
+_clang_getRemappings
+_clang_remap_getNumFiles
+_clang_remap_getFilenames
+_clang_remap_dispose
diff --git a/tools/libclang/libclang.exports b/tools/libclang/libclang.exports
index ac6fc34..47b7030 100644
--- a/tools/libclang/libclang.exports
+++ b/tools/libclang/libclang.exports
@@ -137,8 +137,7 @@
 clang_tokenize
 clang_visitChildren
 clang_visitChildrenWithBlock
-arcmt_getRemappings
-arcmt_remap_getNumFiles
-arcmt_remap_getOriginalFile
-arcmt_remap_getTransformedFile
-arcmt_remap_dispose
+clang_getRemappings
+clang_remap_getNumFiles
+clang_remap_getFilenames
+clang_remap_dispose