clang 22.0.0git
|
#include "clang/Edit/Commit.h"
Classes | |
struct | Edit |
Public Types | |
enum | EditKind { Act_Insert , Act_InsertFromRange , Act_Remove } |
using | edit_iterator = SmallVectorImpl<Edit>::const_iterator |
Public Member Functions | |
Commit (EditedSource &Editor) | |
Commit (const SourceManager &SM, const LangOptions &LangOpts, const PPConditionalDirectiveRecord *PPRec=nullptr) | |
bool | isCommitable () const |
bool | insert (SourceLocation loc, StringRef text, bool afterToken=false, bool beforePreviousInsertions=false) |
bool | insertAfterToken (SourceLocation loc, StringRef text, bool beforePreviousInsertions=false) |
bool | insertBefore (SourceLocation loc, StringRef text) |
bool | insertFromRange (SourceLocation loc, CharSourceRange range, bool afterToken=false, bool beforePreviousInsertions=false) |
bool | insertWrap (StringRef before, CharSourceRange range, StringRef after) |
bool | remove (CharSourceRange range) |
bool | replace (CharSourceRange range, StringRef text) |
bool | replaceWithInner (CharSourceRange range, CharSourceRange innerRange) |
bool | replaceText (SourceLocation loc, StringRef text, StringRef replacementText) |
bool | insertFromRange (SourceLocation loc, SourceRange TokenRange, bool afterToken=false, bool beforePreviousInsertions=false) |
bool | insertWrap (StringRef before, SourceRange TokenRange, StringRef after) |
bool | remove (SourceRange TokenRange) |
bool | replace (SourceRange TokenRange, StringRef text) |
bool | replaceWithInner (SourceRange TokenRange, SourceRange TokenInnerRange) |
edit_iterator | edit_begin () const |
edit_iterator | edit_end () const |
using clang::edit::Commit::edit_iterator = SmallVectorImpl<Edit>::const_iterator |
|
explicit |
Definition at line 42 of file Commit.cpp.
|
inline |
|
inline |
Definition at line 121 of file Commit.h.
Referenced by applyCocoaAPICheck().
|
inline |
Definition at line 122 of file Commit.h.
Referenced by applyCocoaAPICheck().
bool Commit::insert | ( | SourceLocation | loc, |
StringRef | text, | ||
bool | afterToken = false, | ||
bool | beforePreviousInsertions = false ) |
Definition at line 47 of file Commit.cpp.
Referenced by doRewriteToUTF8StringBoxedExpressionHelper(), clang::FixItRewriter::HandleDiagnostic(), insertAfterToken(), insertBefore(), insertWrap(), mergeFixits(), rewriteToBoolLiteral(), rewriteToCharLiteral(), and rewriteToNumberLiteral().
|
inline |
Definition at line 73 of file Commit.h.
References insert().
Referenced by insertWrap(), and rewriteToDictionaryLiteral().
|
inline |
Definition at line 78 of file Commit.h.
References insert().
Referenced by doRewriteToUTF8StringBoxedExpressionHelper(), objectifyExpr(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), and rewriteToNumericBoxedExpression().
bool Commit::insertFromRange | ( | SourceLocation | loc, |
CharSourceRange | range, | ||
bool | afterToken = false, | ||
bool | beforePreviousInsertions = false ) |
Definition at line 63 of file Commit.cpp.
Referenced by clang::FixItRewriter::HandleDiagnostic(), insertFromRange(), mergeFixits(), rewriteToDictionaryLiteral(), and rewriteToDictionarySubscriptSet().
|
inline |
Definition at line 95 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and insertFromRange().
bool Commit::insertWrap | ( | StringRef | before, |
CharSourceRange | range, | ||
StringRef | after ) |
Definition at line 102 of file Commit.cpp.
References insert(), and insertAfterToken().
Referenced by doRewriteToUTF8StringBoxedExpressionHelper(), insertWrap(), maybePutParensOnReceiver(), objectifyExpr(), rewriteToArrayLiteral(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToNumericBoxedExpression(), and rewriteToSubscriptGetCommon().
|
inline |
Definition at line 102 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and insertWrap().
|
inline |
Definition at line 68 of file Commit.h.
Referenced by applyCocoaAPICheck(), and clang::FixItRewriter::HandleDiagnostic().
bool Commit::remove | ( | CharSourceRange | range | ) |
Definition at line 90 of file Commit.cpp.
Referenced by clang::FixItRewriter::HandleDiagnostic(), mergeFixits(), remove(), replace(), and rewriteToDictionaryLiteral().
|
inline |
Definition at line 106 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and remove().
bool Commit::replace | ( | CharSourceRange | range, |
StringRef | text ) |
Definition at line 115 of file Commit.cpp.
References remove().
Referenced by clang::FixItRewriter::HandleDiagnostic(), mergeFixits(), replace(), rewriteToArrayLiteral(), and rewriteToDictionaryLiteral().
|
inline |
Definition at line 110 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and replace().
bool Commit::replaceText | ( | SourceLocation | loc, |
StringRef | text, | ||
StringRef | replacementText ) |
Definition at line 164 of file Commit.cpp.
bool Commit::replaceWithInner | ( | CharSourceRange | range, |
CharSourceRange | innerRange ) |
Definition at line 131 of file Commit.cpp.
References clang::CharSourceRange::getEnd(), clang::edit::FileOffset::getFID(), clang::edit::FileOffset::getOffset(), and clang::edit::FileOffset::getWithOffset().
Referenced by doRewriteToUTF8StringBoxedExpressionHelper(), replaceWithInner(), clang::edit::rewriteObjCRedundantCallWithLiteral(), rewriteToArrayLiteral(), rewriteToArraySubscriptSet(), rewriteToBoolLiteral(), rewriteToCharLiteral(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), and rewriteToSubscriptGetCommon().
|
inline |
Definition at line 114 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and replaceWithInner().