clang 20.0.0git
ARCMTActions.cpp
Go to the documentation of this file.
1//===--- ARCMTActions.cpp - ARC Migrate Tool Frontend Actions ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
12
13using namespace clang;
14using namespace arcmt;
15
20 return false; // errors, stop the action.
21
22 // We only want to see warnings reported from arcmt::checkForManualIssues.
24 return true;
25}
26
27CheckAction::CheckAction(std::unique_ptr<FrontendAction> WrappedAction)
28 : WrapperFrontendAction(std::move(WrappedAction)) {}
29
34}
35
36ModifyAction::ModifyAction(std::unique_ptr<FrontendAction> WrappedAction)
37 : WrapperFrontendAction(std::move(WrappedAction)) {}
38
42 CI.getDiagnostics().getClient(), MigrateDir, EmitPremigrationARCErrors,
43 PlistOut))
44 return false; // errors, stop the action.
45
46 // We only want to see diagnostics emitted by migrateWithTemporaryFiles.
48 return true;
49}
50
51MigrateAction::MigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
52 StringRef migrateDir,
53 StringRef plistOut,
54 bool emitPremigrationARCErrors)
55 : WrapperFrontendAction(std::move(WrappedAction)), MigrateDir(migrateDir),
56 PlistOut(plistOut), EmitPremigrationARCErrors(emitPremigrationARCErrors) {
57 if (MigrateDir.empty())
58 MigrateDir = "."; // user current directory if none is given.
59}
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
DiagnosticsEngine & getDiagnostics() const
Get the current diagnostics engine.
CompilerInvocation & getInvocation()
std::shared_ptr< PCHContainerOperations > getPCHContainerOperations() const
void setIgnoreAllWarnings(bool Val)
When set to true, any unmapped warnings are ignored.
Definition: Diagnostic.h:673
DiagnosticConsumer * getClient()
Definition: Diagnostic.h:595
const FrontendInputFile & getCurrentInput() const
A frontend action which simply wraps some other runtime-specified frontend action.
CheckAction(std::unique_ptr< FrontendAction > WrappedAction)
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
MigrateAction(std::unique_ptr< FrontendAction > WrappedAction, StringRef migrateDir, StringRef plistOut, bool emitPremigrationARCErrors)
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
ModifyAction(std::unique_ptr< FrontendAction > WrappedAction)
bool migrateWithTemporaryFiles(CompilerInvocation &origCI, const FrontendInputFile &Input, std::shared_ptr< PCHContainerOperations > PCHContainerOps, DiagnosticConsumer *DiagClient, StringRef outputDir, bool emitPremigrationARCErrors, StringRef plistOut)
Applies automatic modifications and produces temporary files and metadata into the outputDir path.
Definition: ARCMT.cpp:390
bool applyTransformations(CompilerInvocation &origCI, const FrontendInputFile &Input, std::shared_ptr< PCHContainerOperations > PCHContainerOps, DiagnosticConsumer *DiagClient)
Works similar to checkForManualIssues but instead of checking, it applies automatic modifications to ...
Definition: ARCMT.cpp:382
bool checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input, std::shared_ptr< PCHContainerOperations > PCHContainerOps, DiagnosticConsumer *DiagClient, bool emitPremigrationARCErrors=false, StringRef plistOut=StringRef())
Creates an AST with the provided CompilerInvocation but with these changes: -if a PCH/PTH is set,...
Definition: ARCMT.cpp:235
The JSON file list parser is used to communicate input to InstallAPI.