27 std::shared_ptr<PCHContainerOperations> PCHContainerOps)
28 :
ClangTool(Compilations, SourcePaths,
std::move(PCHContainerOps)) {}
31 return FileToReplaces;
43 &DiagnosticPrinter,
false);
48 llvm::errs() <<
"Skipped some replacements.\n";
51 return saveRewrittenFiles(
Rewrite);
57 Rewrite.getSourceMgr().getFileManager(), FileToReplaces))
63 return Rewrite.overwriteChangedFiles() ? 1 : 0;
67 const std::map<std::string, Replacements> &FileToReplaces,
74 Rewrite.getSourceMgr().getFileManager(), FileToReplaces)) {
75 const std::string &FilePath = FileAndReplaces.first;
76 auto &CurReplaces = FileAndReplaces.second;
84 llvm::errs() << llvm::toString(CurStyle.takeError()) <<
"\n";
88 auto NewReplacements =
90 if (!NewReplacements) {
91 llvm::errs() << llvm::toString(NewReplacements.takeError()) <<
"\n";
Defines the clang::FileManager interface and associated types.
Defines the SourceManager interface.
static llvm::IntrusiveRefCntPtr< DiagnosticIDs > create()
Options for controlling the compiler diagnostics engine.
Concrete class used by the front-end to report problems and issues.
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Implements support for file system lookup, file system caching, and directory search management.
llvm::Expected< FileEntryRef > getFileRef(StringRef Filename, bool OpenFile=false, bool CacheFailure=true, bool IsText=true)
Lookup, cache, and verify the specified file (real or virtual).
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.
This class handles loading and caching of source files into memory.
StringRef getBufferData(FileID FID, bool *Invalid=nullptr) const
Return a StringRef to the source buffer data for the specified FileID.
FileManager & getFileManager() const
FileID getOrCreateFileID(FileEntryRef SourceFile, SrcMgr::CharacteristicKind FileCharacter)
Get the FileID for SourceFile if it exists.
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...
@ Result
The result type of a method or function.