10 #ifndef LLVM_CLANG_EDIT_EDITEDSOURCE_H
11 #define LLVM_CLANG_EDIT_EDITEDSOURCE_H
15 #include "llvm/ADT/DenseMap.h"
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/ADT/TinyPtrVector.h"
18 #include "llvm/Support/Allocator.h"
23 class PPConditionalDirectiveRecord;
38 FileEdit() : RemoveLen(0) {}
41 typedef std::map<FileOffset, FileEdit> FileEditsTy;
42 FileEditsTy FileEdits;
44 llvm::DenseMap<unsigned, llvm::TinyPtrVector<IdentifierInfo*>>
47 CurrCommitMacroArgExps;
50 llvm::BumpPtrAllocator StrAlloc;
55 : SourceMgr(SM), LangOpts(LangOpts), PPRec(PPRec), IdentTable(LangOpts),
71 StringRef
copyString(StringRef str) {
return str.copy(StrAlloc); }
76 bool beforePreviousInsertions);
79 bool beforePreviousInsertions);
89 void startingCommit();
90 void finishedCommit();
void applyRewrites(EditsReceiver &receiver)
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Implements an efficient mapping from strings to IdentifierInfo nodes.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
const SourceManager & getSourceManager() const
Encodes a location in the source.
const TemplateArgument * iterator
Records preprocessor conditional directive regions and allows querying in which region source locatio...
const PPConditionalDirectiveRecord * getPPCondDirectiveRecord() const
StringRef copyString(StringRef str)
bool commit(const Commit &commit)
EditedSource(const SourceManager &SM, const LangOptions &LangOpts, const PPConditionalDirectiveRecord *PPRec=nullptr)
bool canInsertInOffset(SourceLocation OrigLoc, FileOffset Offs)
This class handles loading and caching of source files into memory.
const LangOptions & getLangOpts() const