class EditedSource

Declaration

class EditedSource { /* full declaration omitted */ };

Declared at: clang/include/clang/Edit/EditedSource.h:35

Member Variables

private const clang::SourceManager& SourceMgr
private const clang::LangOptions& LangOpts
private const clang::PPConditionalDirectiveRecord* PPRec
private clang::edit::EditedSource::FileEditsTy FileEdits
private llvm::DenseMap<SourceLocation, SmallVector<MacroArgUse, 2>> ExpansionToArgMap
private SmallVector< std::pair<SourceLocation, MacroArgUse>, 2> CurrCommitMacroArgExps
private clang::IdentifierTable IdentTable
private llvm::BumpPtrAllocator StrAlloc

Method Overview

  • public EditedSource(const clang::SourceManager & SM, const clang::LangOptions & LangOpts, const clang::PPConditionalDirectiveRecord * PPRec = nullptr)
  • public void applyRewrites(clang::edit::EditsReceiver & receiver, bool adjustRemovals = true)
  • public bool canInsertInOffset(clang::SourceLocation OrigLoc, clang::edit::FileOffset Offs)
  • public void clearRewrites()
  • public bool commit(const clang::edit::Commit & commit)
  • private bool commitInsert(clang::SourceLocation OrigLoc, clang::edit::FileOffset Offs, llvm::StringRef text, bool beforePreviousInsertions)
  • private bool commitInsertFromRange(clang::SourceLocation OrigLoc, clang::edit::FileOffset Offs, clang::edit::FileOffset InsertFromRangeOffs, unsigned int Len, bool beforePreviousInsertions)
  • private void commitRemove(clang::SourceLocation OrigLoc, clang::edit::FileOffset BeginOffs, unsigned int Len)
  • public llvm::StringRef copyString(llvm::StringRef str)
  • public llvm::StringRef copyString(const llvm::Twine & twine)
  • private void deconstructMacroArgLoc(clang::SourceLocation Loc, clang::SourceLocation & ExpansionLoc, clang::edit::EditedSource::MacroArgUse & ArgUse)
  • private void finishedCommit()
  • private FileEditsTy::iterator getActionForOffset(clang::edit::FileOffset Offs)
  • public const clang::LangOptions & getLangOpts() const
  • public const clang::PPConditionalDirectiveRecord * getPPCondDirectiveRecord() const
  • public const clang::SourceManager & getSourceManager() const
  • private llvm::StringRef getSourceText(clang::edit::FileOffset BeginOffs, clang::edit::FileOffset EndOffs, bool & Invalid)
  • private void startingCommit()

Methods

EditedSource(
    const clang::SourceManager& SM,
    const clang::LangOptions& LangOpts,
    const clang::PPConditionalDirectiveRecord*
        PPRec = nullptr)

Declared at: clang/include/clang/Edit/EditedSource.h:73

Parameters

const clang::SourceManager& SM
const clang::LangOptions& LangOpts
const clang::PPConditionalDirectiveRecord* PPRec = nullptr

void applyRewrites(
    clang::edit::EditsReceiver& receiver,
    bool adjustRemovals = true)

Declared at: clang/include/clang/Edit/EditedSource.h:88

Parameters

clang::edit::EditsReceiver& receiver
bool adjustRemovals = true

bool canInsertInOffset(
    clang::SourceLocation OrigLoc,
    clang::edit::FileOffset Offs)

Declared at: clang/include/clang/Edit/EditedSource.h:84

Parameters

clang::SourceLocation OrigLoc
clang::edit::FileOffset Offs

void clearRewrites()

Declared at: clang/include/clang/Edit/EditedSource.h:89

bool commit(const clang::edit::Commit& commit)

Declared at: clang/include/clang/Edit/EditedSource.h:86

Parameters

const clang::edit::Commit& commit

bool commitInsert(clang::SourceLocation OrigLoc,
                  clang::edit::FileOffset Offs,
                  llvm::StringRef text,
                  bool beforePreviousInsertions)

Declared at: clang/include/clang/Edit/EditedSource.h:95

Parameters

clang::SourceLocation OrigLoc
clang::edit::FileOffset Offs
llvm::StringRef text
bool beforePreviousInsertions

bool commitInsertFromRange(
    clang::SourceLocation OrigLoc,
    clang::edit::FileOffset Offs,
    clang::edit::FileOffset InsertFromRangeOffs,
    unsigned int Len,
    bool beforePreviousInsertions)

Declared at: clang/include/clang/Edit/EditedSource.h:97

Parameters

clang::SourceLocation OrigLoc
clang::edit::FileOffset Offs
clang::edit::FileOffset InsertFromRangeOffs
unsigned int Len
bool beforePreviousInsertions

void commitRemove(
    clang::SourceLocation OrigLoc,
    clang::edit::FileOffset BeginOffs,
    unsigned int Len)

Declared at: clang/include/clang/Edit/EditedSource.h:100

Parameters

clang::SourceLocation OrigLoc
clang::edit::FileOffset BeginOffs
unsigned int Len

llvm::StringRef copyString(llvm::StringRef str)

Declared at: clang/include/clang/Edit/EditedSource.h:91

Parameters

llvm::StringRef str

llvm::StringRef copyString(
    const llvm::Twine& twine)

Declared at: clang/include/clang/Edit/EditedSource.h:92

Parameters

const llvm::Twine& twine

void deconstructMacroArgLoc(
    clang::SourceLocation Loc,
    clang::SourceLocation& ExpansionLoc,
    clang::edit::EditedSource::MacroArgUse&
        ArgUse)

Declared at: clang/include/clang/Edit/EditedSource.h:105

Parameters

clang::SourceLocation Loc
clang::SourceLocation& ExpansionLoc
clang::edit::EditedSource::MacroArgUse& ArgUse

void finishedCommit()

Declared at: clang/include/clang/Edit/EditedSource.h:110

FileEditsTy::iterator getActionForOffset(
    clang::edit::FileOffset Offs)

Declared at: clang/include/clang/Edit/EditedSource.h:104

Parameters

clang::edit::FileOffset Offs

const clang::LangOptions& getLangOpts() const

Declared at: clang/include/clang/Edit/EditedSource.h:78

const clang::PPConditionalDirectiveRecord*
getPPCondDirectiveRecord() const

Declared at: clang/include/clang/Edit/EditedSource.h:80

const clang::SourceManager& getSourceManager()
    const

Declared at: clang/include/clang/Edit/EditedSource.h:77

llvm::StringRef getSourceText(
    clang::edit::FileOffset BeginOffs,
    clang::edit::FileOffset EndOffs,
    bool& Invalid)

Declared at: clang/include/clang/Edit/EditedSource.h:102

Parameters

clang::edit::FileOffset BeginOffs
clang::edit::FileOffset EndOffs
bool& Invalid

void startingCommit()

Declared at: clang/include/clang/Edit/EditedSource.h:109