clang  3.7.0
Classes | Public Member Functions | Friends | List of all members
clang::FullSourceLoc Class Reference

A SourceLocation and its associated SourceManager. More...

#include <SourceLocation.h>

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

Classes

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

Public Member Functions

 FullSourceLoc ()
 Creates a FullSourceLoc where isValid() returns false. More...
 
 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. More...
 
std::pair< FileID, unsignedgetDecomposedLoc () 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...
 
- Public Member Functions inherited from clang::SourceLocation
 SourceLocation ()
 
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 Public Member Functions inherited from clang::SourceLocation
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...
 

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 ( )
inlineexplicit

Creates a FullSourceLoc where isValid() returns false.

Definition at line 271 of file SourceLocation.h.

clang::FullSourceLoc::FullSourceLoc ( SourceLocation  Loc,
const SourceManager SM 
)
inlineexplicit

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.

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 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
FullSourceLoc FullSourceLoc::getExpansionLoc ( ) const
FileID FullSourceLoc::getFileID ( ) const

Definition at line 80 of file SourceLocation.cpp.

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

const SourceManager& clang::FullSourceLoc::getManager ( ) const
inline
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.

FullSourceLoc FullSourceLoc::getSpellingLoc ( ) const
bool FullSourceLoc::isBeforeInTranslationUnitThan ( SourceLocation  Loc) const

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().

bool clang::FullSourceLoc::isBeforeInTranslationUnitThan ( FullSourceLoc  Loc) const
inline

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().

bool FullSourceLoc::isInSystemHeader ( ) const

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: