clang  3.7.0
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 
29  : WrapperFrontendAction(WrappedAction) {}
30 
34  CI.getDiagnostics().getClient());
35 }
36 
38  : WrapperFrontendAction(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 
53  StringRef migrateDir,
54  StringRef plistOut,
55  bool emitPremigrationARCErrors)
56  : WrapperFrontendAction(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:368
Abstract base class for actions which can be performed by the frontend.
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:380
const FrontendInputFile & getCurrentInput() const
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:233
DiagnosticsEngine & getDiagnostics() const
Get the current diagnostics engine.
CheckAction(FrontendAction *WrappedAction)
std::shared_ptr< PCHContainerOperations > getPCHContainerOperations() const
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:388
void setIgnoreAllWarnings(bool Val)
When set to true, any unmapped warnings are ignored.
Definition: Diagnostic.h:440
A frontend action which simply wraps some other runtime-specified frontend action.
MigrateAction(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...
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
ModifyAction(FrontendAction *WrappedAction)