clang API Documentation

Classes | Public Member Functions | Friends
clang::FullSourceLoc Class Reference

A SourceLocation and its associated SourceManager. More...

#include <SourceLocation.h>

Inheritance diagram for clang::FullSourceLoc:
Inheritance graph
[legend]
Collaboration diagram for clang::FullSourceLoc:
Collaboration graph
[legend]

List of all members.

Classes

struct  BeforeThanCompare
 Comparison function class, useful for sorting FullSourceLocs. More...

Public Member Functions

 FullSourceLoc ()
 Creates a FullSourceLoc where isValid() returns false.
 FullSourceLoc (SourceLocation Loc, const SourceManager &SM)
const SourceManagergetManager () const
FileID getFileID () const
FullSourceLoc getExpansionLoc () const
FullSourceLoc getSpellingLoc () 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
StringRef getBufferData (bool *Invalid=nullptr) const
 Return a StringRef to the source buffer data for the specified FileID.
std::pair< FileID, unsignedgetDecomposedLoc () const
 Decompose the specified location into a raw FileID + Offset pair.
bool isInSystemHeader () const
bool isBeforeInTranslationUnitThan (SourceLocation Loc) const
 Determines the order of 2 source locations in the translation unit.
bool isBeforeInTranslationUnitThan (FullSourceLoc Loc) const
 Determines the order of 2 source locations in the translation unit.
void dump () const
 Prints information about this FullSourceLoc to stderr.

Friends

bool operator== (const FullSourceLoc &LHS, const FullSourceLoc &RHS)
bool operator!= (const FullSourceLoc &LHS, const FullSourceLoc &RHS)

Detailed Description

A SourceLocation and its associated SourceManager.

This is useful for argument passing to functions that expect both objects.

Definition at line 267 of file SourceLocation.h.


Constructor & Destructor Documentation

clang::FullSourceLoc::FullSourceLoc ( ) [inline, explicit]

Creates a FullSourceLoc where isValid() returns false.

Definition at line 271 of file SourceLocation.h.

clang::FullSourceLoc::FullSourceLoc ( SourceLocation  Loc,
const SourceManager SM 
) [inline, explicit]

Definition at line 273 of file SourceLocation.h.


Member Function Documentation

LLVM_DUMP_METHOD void FullSourceLoc::dump ( ) const

Prints information about this FullSourceLoc to stderr.

This is useful for debugging.

Definition at line 126 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 135 of file SourceLocation.cpp.

const char * FullSourceLoc::getCharacterData ( bool Invalid = nullptr) const

Definition at line 130 of file SourceLocation.cpp.

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 140 of file SourceLocation.cpp.

unsigned FullSourceLoc::getExpansionColumnNumber ( bool Invalid = nullptr) const

Definition at line 101 of file SourceLocation.cpp.

Referenced by clang::markup::EmitLocation().

unsigned FullSourceLoc::getExpansionLineNumber ( bool Invalid = nullptr) const

Definition at line 80 of file SourceLocation.cpp.

Referenced by clang::ModuleMap::inferModuleFromLocation().

unsigned FullSourceLoc::getSpellingColumnNumber ( bool Invalid = nullptr) const

Definition at line 111 of file SourceLocation.cpp.

unsigned FullSourceLoc::getSpellingLineNumber ( bool Invalid = nullptr) const

Definition at line 106 of file SourceLocation.cpp.

Determines the order of 2 source locations in the translation unit.

Returns:
true if this source location comes before 'Loc', false otherwise.

Definition at line 121 of file SourceLocation.cpp.

Referenced by clang::arcmt::CapturedDiagList::clearDiagnostic(), compare(), compareCall(), compareControlFlow(), comparePiece(), clang::arcmt::CapturedDiagList::hasDiagnostic(), isBeforeInTranslationUnitThan(), clang::FullSourceLoc::BeforeThanCompare::operator()(), and clang::DiagnosticsEngine::setSeverity().

Determines the order of 2 source locations in the translation unit.

Returns:
true if this source location comes before 'Loc', false otherwise.

Definition at line 316 of file SourceLocation.h.

References isBeforeInTranslationUnitThan(), and clang::SourceLocation::isValid().

Definition at line 116 of file SourceLocation.cpp.


Friends And Related Function Documentation

bool operator!= ( const FullSourceLoc LHS,
const FullSourceLoc RHS 
) [friend]

Definition at line 342 of file SourceLocation.h.

bool operator== ( const FullSourceLoc LHS,
const FullSourceLoc RHS 
) [friend]

Definition at line 336 of file SourceLocation.h.


The documentation for this class was generated from the following files: