15 #ifndef LLVM_CLANG_REWRITE_FRONTEND_FIXITREWRITER_H
16 #define LLVM_CLANG_REWRITE_FRONTEND_FIXITREWRITER_H
42 virtual std::string
RewriteFilename(
const std::string &Filename,
int &fd) = 0;
73 std::unique_ptr<DiagnosticConsumer> Owner;
83 bool PrevDiagSilenced;
113 std::vector<std::pair<std::string, std::string> > *RewrittenFiles=
nullptr);
const RewriteBuffer * getRewriteBufferFor(FileID FID) const
bool WriteFixedFiles(std::vector< std::pair< std::string, std::string > > *RewrittenFiles=nullptr)
Write the modified source files.
bool FixOnlyWarnings
Whether to only fix warnings and not errors.
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool Silent
If true, only pass the diagnostic to the actual diagnostic consumer if it is an error or a fixit was ...
Concrete class used by the front-end to report problems and issues.
~FixItRewriter() override
Destroy the fix-it rewriter.
buffer_iterator buffer_end()
ID
Defines the set of possible language-specific address spaces.
bool WriteFixedFile(FileID ID, raw_ostream &OS)
Write a single modified source file.
FixItRewriter(DiagnosticsEngine &Diags, SourceManager &SourceMgr, const LangOptions &LangOpts, FixItOptions *FixItOpts)
Initialize a new fix-it rewriter.
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
bool FixWhatYouCan
Whether to abort fixing a file when not all errors could be fixed.
void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Rewriter::buffer_iterator iterator
Defines the Diagnostic-related interfaces.
void Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic via the adapted diagnostic client.
bool IsModified(FileID ID) const
Check whether there are modifications for a given file.
std::map< FileID, RewriteBuffer >::iterator buffer_iterator
buffer_iterator buffer_begin()
Defines the clang::SourceLocation class and associated facilities.
Level
The level of the diagnostic, after it has been through mapping.
virtual std::string RewriteFilename(const std::string &Filename, int &fd)=0
This file is about to be rewritten. Return the name of the file that is okay to write to...
This class handles loading and caching of source files into memory.
bool IncludeInDiagnosticCounts() const override