Home
last modified time | relevance | path

Searched refs:CharSourceRange (Results 1 – 25 of 95) sorted by relevance

1234

/freebsd/contrib/llvm-project/clang/lib/Tooling/Transformer/
H A DRangeSelector.cpp100 return [Selector](const MatchResult &Result) -> Expected<CharSourceRange> { in before()
101 Expected<CharSourceRange> SelectedRange = Selector(Result); in before()
104 return CharSourceRange::getCharRange(SelectedRange->getBegin()); in before()
109 return [Selector](const MatchResult &Result) -> Expected<CharSourceRange> { in after()
110 Expected<CharSourceRange> SelectedRange = Selector(Result); in after()
121 CharSourceRange Range = Lexer::makeFileCharRange( in after()
122 CharSourceRange::getTokenRange(SelectedRange->getEnd()), in after()
130 return CharSourceRange::getCharRange(End); in after()
135 return [ID](const MatchResult &Result) -> Expected<CharSourceRange> { in node()
143 : CharSourceRange::getTokenRange(Node->getSourceRange()); in node()
[all …]
H A DSourceCode.cpp31 StringRef clang::tooling::getText(CharSourceRange Range, in getText()
37 CharSourceRange clang::tooling::maybeExtendRange(CharSourceRange Range, in maybeExtendRange()
40 CharSourceRange R = Lexer::getAsCharRange(Range, Context.getSourceManager(), in maybeExtendRange()
50 return CharSourceRange::getTokenRange(Range.getBegin(), Tok.getLocation()); in maybeExtendRange()
53 llvm::Error clang::tooling::validateRange(const CharSourceRange &Range, in validateRange()
84 llvm::Error clang::tooling::validateEditRange(const CharSourceRange &Range, in validateEditRange()
107 static std::optional<CharSourceRange>
128 static CharSourceRange getRangeForSplitTokens(CharSourceRange Range, in getRangeForSplitTokens()
140 return CharSourceRange::getCharRange(BeginLoc, EndToken->getEnd()); in getRangeForSplitTokens()
145 return CharSourceRange::getTokenRange(BeginToken->getBegin(), in getRangeForSplitTokens()
[all …]
H A DRewriteRule.cpp38 Expected<CharSourceRange> Range = E.TargetRange(Result); in translateEdits()
41 std::optional<CharSourceRange> EditRange = in translateEdits()
93 Expected<CharSourceRange> Range = Anchor(Result); in noopEdit()
103 E.Range = CharSourceRange::getCharRange(Begin, Begin); in noopEdit()
452 std::optional<CharSourceRange> RootRange = tooling::getFileRangeForEdit( in getRuleMatchLoc()
453 CharSourceRange::getTokenRange(Root->second.getSourceRange()), in getRuleMatchLoc()
/freebsd/contrib/llvm-project/clang/include/clang/Edit/
H A DCommit.h47 CharSourceRange getFileRange(SourceManager &SM) const;
48 CharSourceRange getInsertFromRange(SourceManager &SM) const;
83 bool insertFromRange(SourceLocation loc, CharSourceRange range,
86 bool insertWrap(StringRef before, CharSourceRange range, StringRef after);
88 bool remove(CharSourceRange range);
90 bool replace(CharSourceRange range, StringRef text);
91 bool replaceWithInner(CharSourceRange range, CharSourceRange innerRange);
98 return insertFromRange(loc, CharSourceRange::getTokenRange(TokenRange),
103 return insertWrap(before, CharSourceRange::getTokenRange(TokenRange), after); in insertWrap()
107 return remove(CharSourceRange::getTokenRange(TokenRange)); in remove()
[all …]
H A DEditsReceiver.h24 virtual void replace(CharSourceRange range, StringRef text) = 0;
27 virtual void remove(CharSourceRange range);
/freebsd/contrib/llvm-project/clang/include/clang/Tooling/
H A DFixIt.h29 StringRef getText(CharSourceRange Range, const ASTContext &Context);
32 inline CharSourceRange getSourceRange(const SourceRange &Range) { in getSourceRange()
33 return CharSourceRange::getTokenRange(Range); in getSourceRange()
37 inline CharSourceRange getSourceRange(const SourceLocation &Loc) { in getSourceRange()
38 return CharSourceRange::getTokenRange(Loc, Loc); in getSourceRange()
43 template <typename T> CharSourceRange getSourceRange(const T &Node) { in getSourceRange()
44 return CharSourceRange::getTokenRange(Node.getSourceRange()); in getSourceRange()
/freebsd/contrib/llvm-project/clang/include/clang/Frontend/
H A DDiagnosticRenderer.h79 ArrayRef<CharSourceRange> Ranges,
84 ArrayRef<CharSourceRange> Ranges) = 0;
88 SmallVectorImpl<CharSourceRange> &Ranges,
111 ArrayRef<CharSourceRange> Ranges, ArrayRef<FixItHint> Hints);
114 ArrayRef<CharSourceRange> Ranges);
116 ArrayRef<CharSourceRange> Ranges,
133 StringRef Message, ArrayRef<CharSourceRange> Ranges,
H A DSARIFDiagnostic.h38 ArrayRef<CharSourceRange> Ranges,
43 ArrayRef<CharSourceRange> Ranges) override;
46 SmallVectorImpl<CharSourceRange> &Ranges, in emitCodeContext()
63 ArrayRef<CharSourceRange> Ranges,
H A DTextDiagnostic.h87 ArrayRef<CharSourceRange> Ranges,
92 ArrayRef<CharSourceRange> Ranges) override;
95 SmallVectorImpl<CharSourceRange> &Ranges, in emitCodeContext()
112 SmallVectorImpl<CharSourceRange> &Ranges,
/freebsd/contrib/llvm-project/clang/include/clang/Rewrite/Core/
H A DRewriter.h90 int getRangeSize(const CharSourceRange &Range,
98 std::string getRewrittenText(CharSourceRange Range) const;
106 return getRewrittenText(CharSourceRange::getTokenRange(Range)); in getRewrittenText()
145 bool RemoveText(CharSourceRange range,
164 bool ReplaceText(CharSourceRange range, StringRef NewStr) { in ReplaceText()
184 bool IncreaseIndentation(CharSourceRange range, SourceLocation parentIndent);
186 return IncreaseIndentation(CharSourceRange::getTokenRange(range), in IncreaseIndentation()
/freebsd/contrib/llvm-project/clang/lib/Frontend/
H A DDiagnosticRenderer.cpp51 void replace(CharSourceRange range, StringRef text) override { in replace()
89 ArrayRef<CharSourceRange> Ranges, in emitDiagnostic()
101 SmallVector<CharSourceRange, 20> MutableRanges(Ranges.begin(), in emitDiagnostic()
271 CharSourceRange MacroRange, MacroArgRange; in retrieveMacroLocation()
279 CharSourceRange(SM->getImmediateSpellingLoc(Loc), IsTokenRange); in retrieveMacroLocation()
284 CharSourceRange(SM->getImmediateSpellingLoc(Loc), IsTokenRange); in retrieveMacroLocation()
356 mapDiagnosticRanges(FullSourceLoc CaretLoc, ArrayRef<CharSourceRange> Ranges, in mapDiagnosticRanges()
357 SmallVectorImpl<CharSourceRange> &SpellingRanges) { in mapDiagnosticRanges()
418 SpellingRanges.push_back(CharSourceRange(SourceRange(Begin, End), in mapDiagnosticRanges()
425 ArrayRef<CharSourceRange> Ranges, in emitCaret()
[all …]
H A DSerializedDiagnosticPrinter.cpp68 ArrayRef<CharSourceRange> Ranges,
73 ArrayRef<CharSourceRange> Ranges) override {} in emitDiagnosticLoc()
78 SmallVectorImpl<CharSourceRange> &Ranges,
193 void EmitCodeContext(SmallVectorImpl<CharSourceRange> &Ranges,
198 void EmitCharSourceRange(CharSourceRange R, const SourceManager &SM);
224 void AddCharSourceRangeToRecord(CharSourceRange R, RecordDataImpl &Record,
360 void SDiagsWriter::AddCharSourceRangeToRecord(CharSourceRange Range, in AddCharSourceRangeToRecord()
391 void SDiagsWriter::EmitCharSourceRange(CharSourceRange R, in EmitCharSourceRange()
670 StringRef Message, ArrayRef<clang::CharSourceRange> Ranges, in emitDiagnosticMessage()
697 void SDiagsWriter::EmitCodeContext(SmallVectorImpl<CharSourceRange> &Ranges, in EmitCodeContext()
[all …]
/freebsd/contrib/llvm-project/clang/lib/Format/
H A DAffectedRangeManager.cpp62 const CharSourceRange &Range) { in affectsCharSourceRange()
63 for (const CharSourceRange &R : Ranges) { in affectsCharSourceRange()
80 CharSourceRange Range = CharSourceRange::getCharRange(Start, End); in affectsTokenRange()
85 CharSourceRange EmptyLineRange = CharSourceRange::getCharRange( in affectsLeadingEmptyLines()
H A DAffectedRangeManager.h28 const ArrayRef<CharSourceRange> Ranges) in AffectedRangeManager()
37 bool affectsCharSourceRange(const CharSourceRange &Range);
59 const SmallVector<CharSourceRange, 8> Ranges;
H A DTokenAnalyzer.h40 ArrayRef<CharSourceRange> getCharRanges() const { return CharRanges; } in getCharRanges()
71 SmallVector<CharSourceRange, 8> CharRanges;
H A DQualifierAlignmentFixer.cpp59 const CharSourceRange &Range, std::string NewText) { in replaceToken()
72 auto Range = CharSourceRange::getCharRange(First->getStartOfNonWhitespace(), in removeToken()
81 auto Range = CharSourceRange::getCharRange(First->Tok.getLocation(), in insertQualifierAfter()
94 auto Range = CharSourceRange::getCharRange(First->getStartOfNonWhitespace(), in insertQualifierBefore()
149 auto Range = CharSourceRange::getCharRange(First->getStartOfNonWhitespace(), in rotateTokens()
362 auto Range = CharSourceRange::getCharRange( in analyzeRight()
/freebsd/contrib/llvm-project/clang/include/clang/Basic/
H A DSourceLocation.h256 class CharSourceRange {
261 CharSourceRange() = default;
262 CharSourceRange(SourceRange R, bool ITR) : Range(R), IsTokenRange(ITR) {}
264 static CharSourceRange getTokenRange(SourceRange R) {
265 return CharSourceRange(R, true);
268 static CharSourceRange getCharRange(SourceRange R) {
269 return CharSourceRange(R, false);
272 static CharSourceRange getTokenRange(SourceLocation B, SourceLocation E) {
276 static CharSourceRange getCharRange(SourceLocation B, SourceLocation E) {
H A DSarif.h178 CharSourceRange Range;
187 ThreadFlow setRange(const CharSourceRange &ItemRange) { in setRange()
325 llvm::SmallVector<CharSourceRange, 8> Locations;
350 SarifResult setLocations(llvm::ArrayRef<CharSourceRange> DiagLocs) { in setLocations()
423 llvm::json::Object createPhysicalLocation(const CharSourceRange &R);
H A DSourceManager.h394 CharSourceRange getExpansionLocRange() const { in getExpansionLocRange()
395 return CharSourceRange( in getExpansionLocRange()
1213 CharSourceRange getImmediateExpansionRange(SourceLocation Loc) const;
1217 CharSourceRange getExpansionRange(SourceLocation Loc) const;
1221 CharSourceRange getExpansionRange(SourceRange Range) const { in getExpansionRange()
1223 CharSourceRange End = getExpansionRange(Range.getEnd()); in getExpansionRange()
1224 return CharSourceRange(SourceRange(Begin, End.getEnd()), in getExpansionRange()
1230 CharSourceRange getExpansionRange(CharSourceRange Range) const { in getExpansionRange()
1231 CharSourceRange Expansion = getExpansionRange(Range.getAsRange()); in getExpansionRange()
/freebsd/contrib/llvm-project/clang/include/clang/Tooling/Transformer/
H A DRangeSelector.h27 using RangeSelector = MatchConsumer<CharSourceRange>;
29 inline RangeSelector charRange(CharSourceRange R) { in charRange()
31 -> Expected<CharSourceRange> { return R; }; in charRange()
/freebsd/contrib/llvm-project/clang/lib/Tooling/
H A DRefactoringCallbacks.cpp75 Sources, CharSourceRange::getTokenRange(From.getSourceRange()), Text); in replaceStmtWithText()
81 Lexer::getSourceText(CharSourceRange::getTokenRange(To.getSourceRange()), in replaceStmtWithStmt()
93 CharSourceRange::getTokenRange(FromMatch->getSourceRange()), ToText)); in run()
215 CharSourceRange Source = in run()
216 CharSourceRange::getTokenRange(NodeIter->second.getSourceRange()); in run()
/freebsd/contrib/llvm-project/clang/lib/Edit/
H A DRewriteObjCFoundationAPI.cpp193 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToSubscriptGetCommon()
195 CharSourceRange::getTokenRange(RecRange)); in rewriteToSubscriptGetCommon()
242 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToArraySubscriptSet()
244 CharSourceRange::getTokenRange(RecRange)); in rewriteToArraySubscriptSet()
245 commit.replaceWithInner(CharSourceRange::getCharRange(Arg0Range.getBegin(), in rewriteToArraySubscriptSet()
247 CharSourceRange::getTokenRange(Arg0Range)); in rewriteToArraySubscriptSet()
250 commit.insertWrap("[", CharSourceRange::getCharRange(Arg0Range.getBegin(), in rewriteToArraySubscriptSet()
281 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToDictionarySubscriptSet()
283 CharSourceRange::getTokenRange(RecRange)); in rewriteToDictionarySubscriptSet()
515 CharSourceRange::getTokenRange(KeyRange), in rewriteToDictionaryLiteral()
[all …]
/freebsd/contrib/llvm-project/clang/lib/Tooling/Refactoring/
H A DASTSelection.cpp20 CharSourceRange getLexicalDeclRange(Decl *D, const SourceManager &SM, in getLexicalDeclRange()
23 return CharSourceRange::getTokenRange(D->getSourceRange()); in getLexicalDeclRange()
31 ? CharSourceRange::getCharRange(R.getBegin(), LocAfterEnd) in getLexicalDeclRange()
32 : CharSourceRange::getTokenRange(R); in getLexicalDeclRange()
124 selectionKindFor(CharSourceRange::getTokenRange(S->getSourceRange())); in TraverseStmt()
140 SourceSelectionKind selectionKindFor(CharSourceRange Range) { in selectionKindFor()
/freebsd/contrib/llvm-project/clang/include/clang/Tooling/Core/
H A DReplacement.h103 Replacement(const SourceManager &Sources, const CharSourceRange &Range,
136 const CharSourceRange &Range,
365 const CharSourceRange Range = in Replacement()
366 CharSourceRange::getTokenRange(NodeToReplace->getSourceRange()); in Replacement()
/freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Core/
H A DSarifDiagnostics.cpp112 static CharSourceRange convertTokenRangeToCharRange(const SourceRange &R, in convertTokenRangeToCharRange()
118 return CharSourceRange::getCharRange(R); in convertTokenRangeToCharRange()
126 return CharSourceRange::getCharRange(BeginCharLoc, EndCharLoc); in convertTokenRangeToCharRange()

1234