forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration drive…
…r option. This is a new mode of migration, where we avoid modifying the original files but we emit temporary files instead. <path> will be used to keep migration process metadata. Currently the temporary files that are produced are put in the system's temp directory but we can put them in the <path> if is necessary. Also introduce new ARC migration functions in libclang whose only purpose, currently, is to accept <path> and provide pairs of original file/transformed file to map from the originals to the files after transformations are applied. Finally introduce the c-arcmt-test utility that exercises the new libclang functions, update arcmt-test, and add tests for the whole process. rdar://9735086. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134844 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
31 changed files
with
646 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/*===-- clang-c/ARCMigrate.h - ARC Migration Public C Interface ---*- C -*-===*\ | ||
|* *| | ||
|* The LLVM Compiler Infrastructure *| | ||
|* *| | ||
|* This file is distributed under the University of Illinois Open Source *| | ||
|* License. See LICENSE.TXT for details. *| | ||
|* *| | ||
|*===----------------------------------------------------------------------===*| | ||
|* *| | ||
|* This header provides a public interface to a Clang library for migrating *| | ||
|* objective-c source files to ARC mode. *| | ||
|* *| | ||
\*===----------------------------------------------------------------------===*/ | ||
|
||
#ifndef CLANG_C_ARCMIGRATE_H | ||
#define CLANG_C_ARCMIGRATE_H | ||
|
||
#include "clang-c/Index.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** \defgroup CARCMT libclang: C Interface to Clang ARC migration library | ||
* | ||
* The C Interface provides a small API that exposes facilities for translating | ||
* objective-c source files of a project to Automatic Reference Counting mode. | ||
* | ||
* To avoid namespace pollution, data types are prefixed with "CMT" and | ||
* functions are prefixed with "arcmt_". | ||
* | ||
* @{ | ||
*/ | ||
|
||
/** | ||
* \brief A remapping of original source files and their translated files. | ||
*/ | ||
typedef void *CMTRemap; | ||
|
||
/** | ||
* \brief Retrieve a remapping. | ||
* | ||
* \param migrate_dir_path the path that clang used during the migration process. | ||
* | ||
* \returns the requested remapping. This remapping must be freed | ||
* via a call to \c arcmt_remap_dispose(). Can return NULL if an error occurred. | ||
*/ | ||
CINDEX_LINKAGE CMTRemap arcmt_getRemappings(const char *migrate_dir_path); | ||
|
||
/** | ||
* \brief Determine the number of remappings. | ||
*/ | ||
CINDEX_LINKAGE unsigned arcmt_remap_getNumFiles(CMTRemap); | ||
|
||
/** | ||
* \brief Get the original filename. | ||
*/ | ||
CINDEX_LINKAGE CXString arcmt_remap_getOriginalFile(CMTRemap, unsigned index); | ||
|
||
/** | ||
* \brief Get the filename that the original file was translated into. | ||
*/ | ||
CINDEX_LINKAGE | ||
CXString arcmt_remap_getTransformedFile(CMTRemap, unsigned index); | ||
|
||
/** | ||
* \brief Dispose the remapping. | ||
*/ | ||
CINDEX_LINKAGE void arcmt_remap_dispose(CMTRemap); | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.