clang 20.0.0git
|
An occurrence of a symbol in the source. More...
#include "clang/Tooling/Refactoring/Rename/SymbolOccurrences.h"
Public Types | |
enum | OccurrenceKind { MatchingSymbol } |
Public Member Functions | |
SymbolOccurrence (const SymbolName &Name, OccurrenceKind Kind, ArrayRef< SourceLocation > Locations) | |
SymbolOccurrence (SymbolOccurrence &&)=default | |
SymbolOccurrence & | operator= (SymbolOccurrence &&)=default |
OccurrenceKind | getKind () const |
ArrayRef< SourceRange > | getNameRanges () const |
An occurrence of a symbol in the source.
Occurrences can have difference kinds, that describe whether this occurrence is an exact semantic match, or whether this is a weaker textual match that's not guaranteed to represent the exact declaration.
A single occurrence of a symbol can span more than one source range. For example, Objective-C selectors can contain multiple argument labels:
We have to replace the text in both range 0 and range 1 when renaming the Objective-C method 'selectorPiece1:selectorPiece2'.
Definition at line 39 of file SymbolOccurrences.h.
Definition at line 41 of file SymbolOccurrences.h.
SymbolOccurrence::SymbolOccurrence | ( | const SymbolName & | Name, |
OccurrenceKind | Kind, | ||
ArrayRef< SourceLocation > | Locations | ||
) |
Definition at line 16 of file SymbolOccurrences.cpp.
References clang::SourceLocation::getLocWithOffset(), Loc, NumRanges, and SingleRange.
|
default |
|
inline |
Definition at line 69 of file SymbolOccurrences.h.
|
inline |
Definition at line 71 of file SymbolOccurrences.h.
References NumRanges, and SingleRange.
|
default |
unsigned clang::tooling::SymbolOccurrence::NumRanges |
Definition at line 82 of file SymbolOccurrences.h.
Referenced by getNameRanges(), and SymbolOccurrence().
SourceRange clang::tooling::SymbolOccurrence::SingleRange |
Definition at line 81 of file SymbolOccurrences.h.
Referenced by getNameRanges(), and SymbolOccurrence().