clang
10.0.0git
|
A SourceLocation and its associated SourceManager. More...
#include "clang/Basic/SourceLocation.h"
Classes | |
struct | BeforeThanCompare |
Comparison function class, useful for sorting FullSourceLocs. More... | |
Public Member Functions | |
FullSourceLoc ()=default | |
Creates a FullSourceLoc where isValid() returns false . More... | |
FullSourceLoc (SourceLocation Loc, const SourceManager &SM) | |
bool | hasManager () const |
const SourceManager & | getManager () const |
FileID | getFileID () const |
FullSourceLoc | getExpansionLoc () const |
FullSourceLoc | getSpellingLoc () const |
FullSourceLoc | getFileLoc () const |
PresumedLoc | getPresumedLoc (bool UseLineDirectives=true) const |
bool | isMacroArgExpansion (FullSourceLoc *StartLoc=nullptr) const |
FullSourceLoc | getImmediateMacroCallerLoc () const |
std::pair< FullSourceLoc, StringRef > | getModuleImportLoc () const |
unsigned | getFileOffset () const |
unsigned | getExpansionLineNumber (bool *Invalid=nullptr) const |
unsigned | getExpansionColumnNumber (bool *Invalid=nullptr) const |
unsigned | getSpellingLineNumber (bool *Invalid=nullptr) const |
unsigned | getSpellingColumnNumber (bool *Invalid=nullptr) const |
const char * | getCharacterData (bool *Invalid=nullptr) const |
unsigned | getLineNumber (bool *Invalid=nullptr) const |
unsigned | getColumnNumber (bool *Invalid=nullptr) const |
const FileEntry * | getFileEntry () const |
StringRef | getBufferData (bool *Invalid=nullptr) const |
Return a StringRef to the source buffer data for the specified FileID. More... | |
std::pair< FileID, unsigned > | getDecomposedLoc () const |
Decompose the specified location into a raw FileID + Offset pair. More... | |
bool | isInSystemHeader () const |
bool | isBeforeInTranslationUnitThan (SourceLocation Loc) const |
Determines the order of 2 source locations in the translation unit. More... | |
bool | isBeforeInTranslationUnitThan (FullSourceLoc Loc) const |
Determines the order of 2 source locations in the translation unit. More... | |
void | dump () const |
Prints information about this FullSourceLoc to stderr. More... | |
![]() | |
bool | isFileID () const |
bool | isMacroID () const |
bool | isValid () const |
Return true if this is a valid SourceLocation object. More... | |
bool | isInvalid () const |
SourceLocation | getLocWithOffset (int Offset) const |
Return a source location with the specified offset from this SourceLocation. More... | |
unsigned | getRawEncoding () const |
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it. More... | |
void * | getPtrEncoding () const |
When a SourceLocation itself cannot be used, this returns an (opaque) pointer encoding for it. More... | |
void | print (raw_ostream &OS, const SourceManager &SM) const |
std::string | printToString (const SourceManager &SM) const |
void | dump (const SourceManager &SM) const |
Friends | |
bool | operator== (const FullSourceLoc &LHS, const FullSourceLoc &RHS) |
bool | operator!= (const FullSourceLoc &LHS, const FullSourceLoc &RHS) |
Additional Inherited Members | |
![]() | |
static SourceLocation | getFromRawEncoding (unsigned Encoding) |
Turn a raw encoding of a SourceLocation object into a real SourceLocation. More... | |
static SourceLocation | getFromPtrEncoding (const void *Encoding) |
Turn a pointer encoding of a SourceLocation object back into a real SourceLocation. More... | |
static bool | isPairOfFileLocations (SourceLocation Start, SourceLocation End) |
A SourceLocation and its associated SourceManager.
This is useful for argument passing to functions that expect both objects.
Definition at line 361 of file SourceLocation.h.
|
default |
Creates a FullSourceLoc where isValid() returns false
.
|
inlineexplicit |
Definition at line 368 of file SourceLocation.h.
LLVM_DUMP_METHOD void FullSourceLoc::dump | ( | ) | const |
Prints information about this FullSourceLoc to stderr.
This is useful for debugging.
Definition at line 237 of file SourceLocation.cpp.
StringRef FullSourceLoc::getBufferData | ( | bool * | Invalid = nullptr | ) | const |
Return a StringRef to the source buffer data for the specified FileID.
Definition at line 246 of file SourceLocation.cpp.
Referenced by buildFixItInsertionLine(), and HandlePopUpPieceEndTag().
const char * FullSourceLoc::getCharacterData | ( | bool * | Invalid = nullptr | ) | const |
Definition at line 241 of file SourceLocation.cpp.
Referenced by HandlePopUpPieceEndTag().
unsigned FullSourceLoc::getColumnNumber | ( | bool * | Invalid = nullptr | ) | const |
Definition at line 197 of file SourceLocation.cpp.
Referenced by buildFixItInsertionLine(), and clang::TextDiagnostic::emitDiagnosticLoc().
std::pair< FileID, unsigned > FullSourceLoc::getDecomposedLoc | ( | ) | const |
Decompose the specified location into a raw FileID + Offset pair.
The first element is the FileID, the second is the offset from the start of the buffer of the location.
Definition at line 251 of file SourceLocation.cpp.
Referenced by clang::tooling::AtomicChange::AtomicChange(), buildFixItInsertionLine(), compareCrossTUSourceLocs(), and HandlePopUpPieceEndTag().
unsigned FullSourceLoc::getExpansionColumnNumber | ( | bool * | Invalid = nullptr | ) | const |
Definition at line 212 of file SourceLocation.cpp.
Referenced by clang::markup::EmitLocation(), and GetHashOfContent().
unsigned FullSourceLoc::getExpansionLineNumber | ( | bool * | Invalid = nullptr | ) | const |
Definition at line 207 of file SourceLocation.cpp.
Referenced by clang::markup::EmitLocation().
FullSourceLoc FullSourceLoc::getExpansionLoc | ( | ) | const |
Definition at line 145 of file SourceLocation.cpp.
Referenced by clang::TextDiagnostic::emitDiagnosticLoc(), clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(), and HandlePopUpPieceEndTag().
const FileEntry * FullSourceLoc::getFileEntry | ( | ) | const |
Definition at line 202 of file SourceLocation.cpp.
Referenced by clang::TextDiagnostic::emitDiagnosticLoc().
FileID FullSourceLoc::getFileID | ( | ) | const |
Definition at line 140 of file SourceLocation.cpp.
Referenced by compareCrossTUSourceLocs(), clang::TextDiagnostic::emitDiagnosticLoc(), mapDiagnosticRanges(), and updateExecutedLinesWithDiagnosticPieces().
FullSourceLoc FullSourceLoc::getFileLoc | ( | ) | const |
Definition at line 155 of file SourceLocation.cpp.
Referenced by clang::DiagnosticRenderer::emitDiagnostic().
unsigned FullSourceLoc::getFileOffset | ( | ) | const |
Definition at line 187 of file SourceLocation.cpp.
FullSourceLoc FullSourceLoc::getImmediateMacroCallerLoc | ( | ) | const |
Definition at line 172 of file SourceLocation.cpp.
unsigned FullSourceLoc::getLineNumber | ( | bool * | Invalid = nullptr | ) | const |
Definition at line 192 of file SourceLocation.cpp.
Referenced by buildFixItInsertionLine(), clang::TextDiagnostic::emitDiagnosticLoc(), and updateExecutedLinesWithDiagnosticPieces().
|
inline |
Definition at line 378 of file SourceLocation.h.
Referenced by buildFixItInsertionLine(), checkRangesForMacroArgExpansion(), compare(), compareCrossTUSourceLocs(), comparePiece(), clang::ento::PathDiagnosticLocation::createSingleLocation(), Diag(), clang::DiagnosticRenderer::emitDiagnostic(), clang::TextDiagnostic::emitDiagnosticLoc(), clang::DiagnosticRenderer::emitStoredDiagnostic(), getStableLevel(), HandlePopUpPieceEndTag(), MakeCharSourceRange(), makeStandaloneDiagnostic(), and mapDiagnosticRanges().
std::pair< FullSourceLoc, StringRef > FullSourceLoc::getModuleImportLoc | ( | ) | const |
Definition at line 177 of file SourceLocation.cpp.
Referenced by clang::DiagnosticRenderer::emitStoredDiagnostic().
PresumedLoc FullSourceLoc::getPresumedLoc | ( | bool | UseLineDirectives = true | ) | const |
Definition at line 160 of file SourceLocation.cpp.
Referenced by clang::DiagnosticRenderer::emitDiagnostic(), clang::DiagnosticRenderer::emitStoredDiagnostic(), and getStableLevel().
unsigned FullSourceLoc::getSpellingColumnNumber | ( | bool * | Invalid = nullptr | ) | const |
Definition at line 222 of file SourceLocation.cpp.
unsigned FullSourceLoc::getSpellingLineNumber | ( | bool * | Invalid = nullptr | ) | const |
Definition at line 217 of file SourceLocation.cpp.
FullSourceLoc FullSourceLoc::getSpellingLoc | ( | ) | const |
Definition at line 150 of file SourceLocation.cpp.
Referenced by clang::tooling::AtomicChange::AtomicChange(), compareCrossTUSourceLocs(), and mapDiagnosticRanges().
|
inline |
Definition at line 371 of file SourceLocation.h.
Referenced by clang::DiagnosticRenderer::emitDiagnostic(), and getStableLevel().
bool FullSourceLoc::isBeforeInTranslationUnitThan | ( | SourceLocation | Loc | ) | const |
Determines the order of 2 source locations in the translation unit.
Definition at line 232 of file SourceLocation.cpp.
Referenced by clang::arcmt::CapturedDiagList::clearDiagnostic(), compareCall(), compareControlFlow(), compareCrossTUSourceLocs(), comparePiece(), clang::arcmt::CapturedDiagList::hasDiagnostic(), and clang::FullSourceLoc::BeforeThanCompare::operator()().
|
inline |
Determines the order of 2 source locations in the translation unit.
Definition at line 427 of file SourceLocation.h.
References clang::SourceLocation::isValid().
bool FullSourceLoc::isInSystemHeader | ( | ) | const |
Definition at line 227 of file SourceLocation.cpp.
bool FullSourceLoc::isMacroArgExpansion | ( | FullSourceLoc * | StartLoc = nullptr | ) | const |
Definition at line 167 of file SourceLocation.cpp.
Referenced by checkRangesForMacroArgExpansion().
|
friend |
Definition at line 452 of file SourceLocation.h.
|
friend |
Definition at line 446 of file SourceLocation.h.