#include "clang/ARCMigrate/ARCMT.h"
#include "Internals.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/Basic/DiagnosticCategories.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Frontend/Utils.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "clang/Sema/SemaDiagnostic.h"
#include "clang/Serialization/ASTReader.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/TargetParser/Triple.h"
#include <utility>
usingnamespaceclang;
usingnamespacearcmt;
bool CapturedDiagList::clearDiagnostic(ArrayRef<unsigned> IDs,
SourceRange range) { … }
bool CapturedDiagList::hasDiagnostic(ArrayRef<unsigned> IDs,
SourceRange range) const { … }
void CapturedDiagList::reportDiagnostics(DiagnosticsEngine &Diags) const { … }
bool CapturedDiagList::hasErrors() const { … }
namespace {
class CaptureDiagnosticConsumer : public DiagnosticConsumer { … };
}
static bool HasARCRuntime(CompilerInvocation &origCI) { … }
static CompilerInvocation *
createInvocationForMigration(CompilerInvocation &origCI,
const PCHContainerReader &PCHContainerRdr) { … }
static void emitPremigrationErrors(const CapturedDiagList &arcDiags,
DiagnosticOptions *diagOpts,
Preprocessor &PP) { … }
bool arcmt::checkForManualIssues(
CompilerInvocation &origCI, const FrontendInputFile &Input,
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *DiagClient, bool emitPremigrationARCErrors,
StringRef plistOut) { … }
static bool
applyTransforms(CompilerInvocation &origCI, const FrontendInputFile &Input,
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *DiagClient, StringRef outputDir,
bool emitPremigrationARCErrors, StringRef plistOut) { … }
bool arcmt::applyTransformations(
CompilerInvocation &origCI, const FrontendInputFile &Input,
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *DiagClient) { … }
bool arcmt::migrateWithTemporaryFiles(
CompilerInvocation &origCI, const FrontendInputFile &Input,
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *DiagClient, StringRef outputDir,
bool emitPremigrationARCErrors, StringRef plistOut) { … }
bool arcmt::getFileRemappings(std::vector<std::pair<std::string,std::string> > &
remap,
StringRef outputDir,
DiagnosticConsumer *DiagClient) { … }
namespace {
class ARCMTMacroTrackerPPCallbacks : public PPCallbacks { … };
class ARCMTMacroTrackerAction : public ASTFrontendAction { … };
class RewritesApplicator : public TransformActions::RewriteReceiver { … };
}
MigrationProcess::RewriteListener::~RewriteListener() { … }
MigrationProcess::MigrationProcess(
CompilerInvocation &CI,
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *diagClient, StringRef outputDir)
: … { … }
bool MigrationProcess::applyTransform(TransformFn trans,
RewriteListener *listener) { … }