15#ifndef LLVM_CLANG_REWRITE_FRONTEND_FIXITREWRITER_H
16#define LLVM_CLANG_REWRITE_FRONTEND_FIXITREWRITER_H
75 std::unique_ptr<DiagnosticConsumer> Owner;
82 unsigned NumFailures = 0;
85 bool PrevDiagSilenced =
false;
97 return Rewrite.getRewriteBufferFor(
ID) !=
nullptr;
115 std::vector<std::pair<std::string, std::string>> *RewrittenFiles =
nullptr);
Defines the Diagnostic-related interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
Concrete class used by the front-end to report problems and issues.
Level
The level of the diagnostic, after it has been through mapping.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
bool FixOnlyWarnings
Whether to only fix warnings and not errors.
bool FixWhatYouCan
Whether to abort fixing a file when not all errors could be fixed.
virtual std::string RewriteFilename(const std::string &Filename, int &fd)=0
This file is about to be rewritten.
bool Silent
If true, only pass the diagnostic to the actual diagnostic consumer if it is an error or a fixit was ...
bool InPlace
True if files should be updated in place.
Rewriter::buffer_iterator iterator
void Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic via the adapted diagnostic client.
bool WriteFixedFiles(std::vector< std::pair< std::string, std::string > > *RewrittenFiles=nullptr)
Write the modified source files.
bool WriteFixedFile(FileID ID, raw_ostream &OS)
Write a single modified source file.
void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override
HandleDiagnostic - Handle this diagnostic, reporting it to the user or capturing it to a log as neede...
bool IsModified(FileID ID) const
Check whether there are modifications for a given file.
~FixItRewriter() override
Destroy the fix-it rewriter.
bool IncludeInDiagnosticCounts() const override
IncludeInDiagnosticCounts - This method (whose default implementation returns true) indicates whether...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Rewriter - This is the main interface to the rewrite buffers.
std::map< FileID, llvm::RewriteBuffer >::iterator buffer_iterator
Encodes a location in the source.
This class handles loading and caching of source files into memory.
The JSON file list parser is used to communicate input to InstallAPI.
@ Rewrite
We are substituting template parameters for (typically) other template parameters in order to rewrite...