9#ifndef LLVM_CLANG_EDIT_EDITEDSOURCE_H
10#define LLVM_CLANG_EDIT_EDITEDSOURCE_H
16#include "llvm/ADT/ArrayRef.h"
17#include "llvm/ADT/DenseMap.h"
18#include "llvm/ADT/SmallVector.h"
19#include "llvm/ADT/StringRef.h"
20#include "llvm/Support/Allocator.h"
44 unsigned RemoveLen = 0;
49 using FileEditsTy = std::map<FileOffset, FileEdit>;
51 FileEditsTy FileEdits;
61 return std::tie(Identifier, ImmediateExpansionLoc, UseLoc) ==
62 std::tie(
Other.Identifier,
Other.ImmediateExpansionLoc,
67 llvm::DenseMap<SourceLocation, SmallVector<MacroArgUse, 2>> ExpansionToArgMap;
69 CurrCommitMacroArgExps;
72 llvm::BumpPtrAllocator StrAlloc;
77 : SourceMgr(SM), LangOpts(LangOpts), PPRec(PPRec), IdentTable(LangOpts) {}
93 StringRef
copyString(StringRef str) {
return str.copy(StrAlloc); }
98 bool beforePreviousInsertions);
101 bool beforePreviousInsertions);
106 FileEditsTy::iterator getActionForOffset(
FileOffset Offs);
109 MacroArgUse &ArgUse);
111 void startingCommit();
112 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.
Annotates a diagnostic with some code that should be inserted, removed, or replaced to fix the proble...
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
void mergeFixits(ArrayRef< FixItHint > FixItHints, const SourceManager &SM, const LangOptions &LangOpts, SmallVectorImpl< FixItHint > &MergedFixits)
Merges FixItHints into a normalized set of file edits.
Top level wrappers for InstallAPI frontend operations.
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
@ Other
Other implicit parameter.