clang  6.0.0svn
ARCMTActions.cpp
Go to the documentation of this file.
1 //===--- ARCMTActions.cpp - ARC Migrate Tool Frontend Actions ---*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include "clang/ARCMigrate/ARCMT.h"
13 
14 using namespace clang;
15 using namespace arcmt;
16 
20  CI.getDiagnostics().getClient()))
21  return false; // errors, stop the action.
22 
23  // We only want to see warnings reported from arcmt::checkForManualIssues.
25  return true;
26 }
27 
28 CheckAction::CheckAction(std::unique_ptr<FrontendAction> WrappedAction)
29  : WrapperFrontendAction(std::move(WrappedAction)) {}
30 
34  CI.getDiagnostics().getClient());
35 }
36 
37 ModifyAction::ModifyAction(std::unique_ptr<FrontendAction> WrappedAction)
38  : WrapperFrontendAction(std::move(WrappedAction)) {}
39 
43  CI.getDiagnostics().getClient(), MigrateDir, EmitPremigrationARCErros,
44  PlistOut))
45  return false; // errors, stop the action.
46 
47  // We only want to see diagnostics emitted by migrateWithTemporaryFiles.
49  return true;
50 }
51 
52 MigrateAction::MigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
53  StringRef migrateDir,
54  StringRef plistOut,
55  bool emitPremigrationARCErrors)
56  : WrapperFrontendAction(std::move(WrappedAction)), MigrateDir(migrateDir),
57  PlistOut(plistOut), EmitPremigrationARCErros(emitPremigrationARCErrors) {
58  if (MigrateDir.empty())
59  MigrateDir = "."; // user current directory if none is given.
60 }
CompilerInvocation & getInvocation()
DiagnosticConsumer * getClient()
Definition: Diagnostic.h:427
std::shared_ptr< PCHContainerOperations > getPCHContainerOperations() const
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
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:386
Definition: Format.h:1900
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:239
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
CheckAction(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:394
ModifyAction(std::unique_ptr< FrontendAction > WrappedAction)
void setIgnoreAllWarnings(bool Val)
When set to true, any unmapped warnings are ignored.
Definition: Diagnostic.h:503
Dataflow Directional Tag Classes.
const FrontendInputFile & getCurrentInput() const
A frontend action which simply wraps some other runtime-specified frontend action.
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...
DiagnosticsEngine & getDiagnostics() const
Get the current diagnostics engine.
MigrateAction(std::unique_ptr< FrontendAction > WrappedAction, StringRef migrateDir, StringRef plistOut, bool emitPremigrationARCErrors)