10 #ifndef LLVM_CLANG_ARCMIGRATE_FILEREMAPPER_H
11 #define LLVM_CLANG_ARCMIGRATE_FILEREMAPPER_H
14 #include "llvm/ADT/DenseMap.h"
15 #include "llvm/ADT/PointerUnion.h"
16 #include "llvm/ADT/StringRef.h"
26 class DiagnosticsEngine;
27 class PreprocessorOptions;
33 std::unique_ptr<FileManager> FileMgr;
35 typedef llvm::PointerUnion<const FileEntry *, llvm::MemoryBuffer *> Target;
36 typedef llvm::DenseMap<const FileEntry *, Target> MappingsTy;
37 MappingsTy FromToMappings;
39 llvm::DenseMap<const FileEntry *, const FileEntry *> ToFromMappings;
46 bool ignoreIfFilesChanged);
48 bool ignoreIfFilesChanged);
53 StringRef outputDir = StringRef());
55 void remap(StringRef filePath, std::unique_ptr<llvm::MemoryBuffer> memBuf);
59 void clear(StringRef outputDir = StringRef());
62 void remap(
const FileEntry *file, std::unique_ptr<llvm::MemoryBuffer> memBuf);
65 const FileEntry *getOriginalFile(StringRef filePath);
66 void resetTarget(Target &targ);
70 std::string getRemapInfoFile(StringRef outputDir);
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
void remap(StringRef filePath, std::unique_ptr< llvm::MemoryBuffer > memBuf)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Concrete class used by the front-end to report problems and issues.
bool flushToFile(StringRef outputPath, DiagnosticsEngine &Diag)
void applyMappings(PreprocessorOptions &PPOpts) const
bool initFromFile(StringRef filePath, DiagnosticsEngine &Diag, bool ignoreIfFilesChanged)
bool overwriteOriginal(DiagnosticsEngine &Diag, StringRef outputDir=StringRef())
bool flushToDisk(StringRef outputDir, DiagnosticsEngine &Diag)
Cached information about one file (either on disk or in the virtual file system). ...
bool initFromDisk(StringRef outputDir, DiagnosticsEngine &Diag, bool ignoreIfFilesChanged)
void clear(StringRef outputDir=StringRef())