aboutsummaryrefslogtreecommitdiff
path: root/include/clang/ARCMigrate/ARCMT.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/ARCMigrate/ARCMT.h')
-rw-r--r--include/clang/ARCMigrate/ARCMT.h46
1 files changed, 32 insertions, 14 deletions
diff --git a/include/clang/ARCMigrate/ARCMT.h b/include/clang/ARCMigrate/ARCMT.h
index ad5cf4a2c16c..d8dea0b3adb9 100644
--- a/include/clang/ARCMigrate/ARCMT.h
+++ b/include/clang/ARCMigrate/ARCMT.h
@@ -15,7 +15,7 @@
namespace clang {
class ASTContext;
- class DiagnosticClient;
+ class DiagnosticConsumer;
namespace arcmt {
class MigrationPass;
@@ -28,35 +28,53 @@ namespace arcmt {
/// It then checks the AST and produces errors/warning for ARC migration issues
/// that the user needs to handle manually.
///
+/// \param emitPremigrationARCErrors if true all ARC errors will get emitted
+/// even if the migrator can fix them, but the function will still return false
+/// if all ARC errors can be fixed.
+///
+/// \param plistOut if non-empty, it is the file path to store the plist with
+/// the pre-migration ARC diagnostics.
+///
/// \returns false if no error is produced, true otherwise.
bool checkForManualIssues(CompilerInvocation &CI,
- llvm::StringRef Filename, InputKind Kind,
- DiagnosticClient *DiagClient);
+ StringRef Filename, InputKind Kind,
+ DiagnosticConsumer *DiagClient,
+ bool emitPremigrationARCErrors = false,
+ StringRef plistOut = StringRef());
/// \brief Works similar to checkForManualIssues but instead of checking, it
/// applies automatic modifications to source files to conform to ARC.
///
/// \returns false if no error is produced, true otherwise.
bool applyTransformations(CompilerInvocation &origCI,
- llvm::StringRef Filename, InputKind Kind,
- DiagnosticClient *DiagClient);
+ StringRef Filename, InputKind Kind,
+ DiagnosticConsumer *DiagClient);
/// \brief Applies automatic modifications and produces temporary files
/// and metadata into the \arg outputDir path.
///
+/// \param emitPremigrationARCErrors if true all ARC errors will get emitted
+/// even if the migrator can fix them, but the function will still return false
+/// if all ARC errors can be fixed.
+///
+/// \param plistOut if non-empty, it is the file path to store the plist with
+/// the pre-migration ARC diagnostics.
+///
/// \returns false if no error is produced, true otherwise.
bool migrateWithTemporaryFiles(CompilerInvocation &origCI,
- llvm::StringRef Filename, InputKind Kind,
- DiagnosticClient *DiagClient,
- llvm::StringRef outputDir);
+ StringRef Filename, InputKind Kind,
+ DiagnosticConsumer *DiagClient,
+ StringRef outputDir,
+ bool emitPremigrationARCErrors,
+ StringRef plistOut);
/// \brief Get the set of file remappings from the \arg outputDir path that
/// migrateWithTemporaryFiles produced.
///
/// \returns false if no error is produced, true otherwise.
bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
- llvm::StringRef outputDir,
- DiagnosticClient *DiagClient);
+ StringRef outputDir,
+ DiagnosticConsumer *DiagClient);
typedef void (*TransformFn)(MigrationPass &pass);
@@ -64,12 +82,12 @@ std::vector<TransformFn> getAllTransformations();
class MigrationProcess {
CompilerInvocation OrigCI;
- DiagnosticClient *DiagClient;
+ DiagnosticConsumer *DiagClient;
FileRemapper Remapper;
public:
- MigrationProcess(const CompilerInvocation &CI, DiagnosticClient *diagClient,
- llvm::StringRef outputDir = llvm::StringRef());
+ MigrationProcess(const CompilerInvocation &CI, DiagnosticConsumer *diagClient,
+ StringRef outputDir = StringRef());
class RewriteListener {
public:
@@ -78,7 +96,7 @@ public:
virtual void start(ASTContext &Ctx) { }
virtual void finish() { }
- virtual void insert(SourceLocation loc, llvm::StringRef text) { }
+ virtual void insert(SourceLocation loc, StringRef text) { }
virtual void remove(CharSourceRange range) { }
};