clang
7.0.0
|
#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 44 of file Commit.cpp.
|
inline |
|
inline |
|
inline |
Definition at line 123 of file Commit.h.
References length(), and clang::edit::Commit::Edit::OrigLoc.
bool Commit::insert | ( | SourceLocation | loc, |
StringRef | text, | ||
bool | afterToken = false , |
||
bool | beforePreviousInsertions = false |
||
) |
Definition at line 49 of file Commit.cpp.
Referenced by doRewriteToUTF8StringBoxedExpressionHelper(), clang::FixItRewriter::HandleDiagnostic(), hasSuperInitCall(), insertAfterToken(), insertBefore(), insertWrap(), isCommitable(), mergeFixits(), rewriteToBoolLiteral(), rewriteToCharLiteral(), and rewriteToNumberLiteral().
|
inline |
Definition at line 74 of file Commit.h.
References insert().
Referenced by AuditedType(), insertWrap(), rewriteToDictionaryLiteral(), and rewriteToObjCInterfaceDecl().
|
inline |
Definition at line 79 of file Commit.h.
References insert(), insertFromRange(), insertWrap(), replace(), replaceText(), and replaceWithInner().
Referenced by AuditedType(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), doRewriteToUTF8StringBoxedExpressionHelper(), objectifyExpr(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), and rewriteToNumericBoxedExpression().
bool Commit::insertFromRange | ( | SourceLocation | loc, |
CharSourceRange | range, | ||
bool | afterToken = false , |
||
bool | beforePreviousInsertions = false |
||
) |
Definition at line 65 of file Commit.cpp.
References clang::PPConditionalDirectiveRecord::areInDifferentConditionalDirectiveRegion(), and clang::CharSourceRange::getBegin().
Referenced by clang::FixItRewriter::HandleDiagnostic(), insertBefore(), insertFromRange(), mergeFixits(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), and rewriteToNSEnumDecl().
|
inline |
Definition at line 96 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and insertFromRange().
bool Commit::insertWrap | ( | StringRef | before, |
CharSourceRange | range, | ||
StringRef | after | ||
) |
Definition at line 104 of file Commit.cpp.
References clang::CharSourceRange::getBegin(), clang::CharSourceRange::getEnd(), insert(), insertAfterToken(), and clang::CharSourceRange::isTokenRange().
Referenced by clang::arcmt::ObjCMigrateAction::BeginInvocation(), doRewriteToUTF8StringBoxedExpressionHelper(), insertBefore(), insertWrap(), maybePutParensOnReceiver(), objectifyExpr(), rewriteToArrayLiteral(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToNumericBoxedExpression(), and rewriteToSubscriptGetCommon().
|
inline |
Definition at line 103 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and insertWrap().
|
inline |
Definition at line 69 of file Commit.h.
References insert(), and clang::comments::tok::text.
Referenced by clang::edit::EditedSource::commit(), and clang::FixItRewriter::HandleDiagnostic().
bool Commit::remove | ( | CharSourceRange | range | ) |
Definition at line 92 of file Commit.cpp.
References clang::CharSourceRange::getBegin().
Referenced by clang::FixItRewriter::HandleDiagnostic(), mergeFixits(), rewriteToDictionaryLiteral(), rewriteToNSEnumDecl(), rewriteToNSMacroDecl(), and rewriteToObjCProperty().
|
inline |
Definition at line 107 of file Commit.h.
References clang::CharSourceRange::getTokenRange().
bool Commit::replace | ( | CharSourceRange | range, |
StringRef | text | ||
) |
Definition at line 117 of file Commit.cpp.
References clang::CharSourceRange::getBegin(), and clang::comments::tok::text.
Referenced by clang::arcmt::ObjCMigrateAction::BeginInvocation(), clang::FixItRewriter::HandleDiagnostic(), insertBefore(), mergeFixits(), replace(), ReplaceWithClasstype(), ReplaceWithInstancetype(), rewriteToArrayLiteral(), rewriteToDictionaryLiteral(), rewriteToNSEnumDecl(), rewriteToNSMacroDecl(), and rewriteToObjCProperty().
|
inline |
Definition at line 111 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and replace().
bool Commit::replaceText | ( | SourceLocation | loc, |
StringRef | text, | ||
StringRef | replacementText | ||
) |
Definition at line 166 of file Commit.cpp.
References Act_Insert, Act_InsertFromRange, Act_Remove, clang::edit::Commit::Edit::BeforePrev, clang::edit::EditedSource::canInsertInOffset(), clang::CharSourceRange::getAsRange(), clang::CharSourceRange::getBegin(), clang::SourceManager::getBufferData(), clang::SourceManager::getDecomposedLoc(), clang::CharSourceRange::getEnd(), clang::edit::FileOffset::getFID(), clang::Lexer::getLocForEndOfToken(), clang::SourceLocation::getLocWithOffset(), clang::edit::FileOffset::getOffset(), clang::SourceManager::getSpellingLoc(), clang::SourceManager::getTopMacroCallerLoc(), clang::edit::FileOffset::getWithOffset(), clang::edit::Commit::Edit::InsertFromRangeOffs, clang::Lexer::isAtEndOfMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), clang::SourceManager::isInSystemHeader(), clang::SourceLocation::isInvalid(), clang::CharSourceRange::isInvalid(), clang::SourceLocation::isMacroID(), clang::edit::Commit::Edit::Kind, clang::edit::Commit::Edit::Length, clang::Lexer::makeFileCharRange(), clang::Lexer::MeasureTokenLength(), clang::edit::Commit::Edit::Offset, clang::edit::Commit::Edit::OrigLoc, clang::PPConditionalDirectiveRecord::rangeIntersectsConditionalDirective(), SM, clang::comments::tok::text, and clang::edit::Commit::Edit::Text.
Referenced by insertBefore().
bool Commit::replaceWithInner | ( | CharSourceRange | range, |
CharSourceRange | innerRange | ||
) |
Definition at line 133 of file Commit.cpp.
References clang::CharSourceRange::getBegin(), clang::CharSourceRange::getEnd(), clang::edit::FileOffset::getFID(), clang::edit::FileOffset::getOffset(), and clang::edit::FileOffset::getWithOffset().
Referenced by doRewriteToUTF8StringBoxedExpressionHelper(), insertBefore(), replaceWithInner(), clang::edit::rewriteObjCRedundantCallWithLiteral(), rewriteToArrayLiteral(), rewriteToArraySubscriptSet(), rewriteToBoolLiteral(), rewriteToCharLiteral(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), and rewriteToSubscriptGetCommon().
|
inline |
Definition at line 115 of file Commit.h.
References clang::CharSourceRange::getTokenRange(), and replaceWithInner().