9#ifndef LLVM_CLANG_EDIT_EDITEDSOURCE_H
10#define LLVM_CLANG_EDIT_EDITEDSOURCE_H
16#include "llvm/ADT/DenseMap.h"
17#include "llvm/ADT/SmallVector.h"
18#include "llvm/ADT/StringRef.h"
19#include "llvm/Support/Allocator.h"
27class PPConditionalDirectiveRecord;
42 unsigned RemoveLen = 0;
47 using FileEditsTy = std::map<FileOffset, FileEdit>;
49 FileEditsTy FileEdits;
59 return std::tie(
Identifier, ImmediateExpansionLoc, UseLoc) ==
60 std::tie(
Other.Identifier,
Other.ImmediateExpansionLoc,
65 llvm::DenseMap<SourceLocation, SmallVector<MacroArgUse, 2>> ExpansionToArgMap;
67 CurrCommitMacroArgExps;
70 llvm::BumpPtrAllocator StrAlloc;
75 : SourceMgr(
SM), LangOpts(LangOpts), PPRec(PPRec), IdentTable(LangOpts) {}
91 StringRef
copyString(StringRef str) {
return str.copy(StrAlloc); }
96 bool beforePreviousInsertions);
99 bool beforePreviousInsertions);
104 FileEditsTy::iterator getActionForOffset(
FileOffset Offs);
107 MacroArgUse &ArgUse);
109 void startingCommit();
110 void finishedCommit();
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
One of these records is kept for each identifier that is lexed.
Implements an efficient mapping from strings to IdentifierInfo nodes.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Records preprocessor conditional directive regions and allows querying in which region source locatio...
Encodes a location in the source.
This class handles loading and caching of source files into memory.
const LangOptions & getLangOpts() const
StringRef copyString(StringRef str)
const PPConditionalDirectiveRecord * getPPCondDirectiveRecord() const
bool canInsertInOffset(SourceLocation OrigLoc, FileOffset Offs)
void applyRewrites(EditsReceiver &receiver, bool adjustRemovals=true)
bool commit(const Commit &commit)
EditedSource(const SourceManager &SM, const LangOptions &LangOpts, const PPConditionalDirectiveRecord *PPRec=nullptr)
const SourceManager & getSourceManager() const
The JSON file list parser is used to communicate input to InstallAPI.
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
@ Other
Other implicit parameter.