class FullSourceLoc

Declaration

class FullSourceLoc : public SourceLocation { /* full declaration omitted */ };

Description

A SourceLocation and its associated SourceManager. This is useful for argument passing to functions that expect both objects. This class does not guarantee the presence of either the SourceManager or a valid SourceLocation. Clients should use `isValid()` and `hasManager()` before calling the member functions.

Declared at: clang/include/clang/Basic/SourceLocation.h:368

Inherits from: SourceLocation

Member Variables

private const clang::SourceManager* SrcMgr = nullptr

Method Overview

Inherited from SourceLocation:

Methods

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

Declared at: clang/include/clang/Basic/SourceLocation.h:375

Parameters

clang::SourceLocation Loc
const clang::SourceManager& SM

FullSourceLoc()

Description

Creates a FullSourceLoc where isValid() returns \c false.

Declared at: clang/include/clang/Basic/SourceLocation.h:373

void dump() const

Description

Prints information about this FullSourceLoc to stderr. This is useful for debugging.

Declared at: clang/include/clang/Basic/SourceLocation.h:447

llvm::StringRef getBufferData(
    bool* Invalid = nullptr) const

Description

Return a StringRef to the source buffer data for the specified FileID.

Declared at: clang/include/clang/Basic/SourceLocation.h:413

Parameters

bool* Invalid = nullptr

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

Declared at: clang/include/clang/Basic/SourceLocation.h:404

Parameters

bool* Invalid = nullptr

unsigned int getColumnNumber(
    bool* Invalid = nullptr) const

Declared at: clang/include/clang/Basic/SourceLocation.h:407

Parameters

bool* Invalid = nullptr

std::pair<FileID, unsigned int> getDecomposedLoc()
    const

Description

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.

Declared at: clang/include/clang/Basic/SourceLocation.h:419

unsigned int getExpansionColumnNumber(
    bool* Invalid = nullptr) const

Declared at: clang/include/clang/Basic/SourceLocation.h:399

Parameters

bool* Invalid = nullptr

unsigned int getExpansionLineNumber(
    bool* Invalid = nullptr) const

Declared at: clang/include/clang/Basic/SourceLocation.h:398

Parameters

bool* Invalid = nullptr

clang::FullSourceLoc getExpansionLoc() const

Declared at: clang/include/clang/Basic/SourceLocation.h:389

const clang::FileEntry* getFileEntry() const

Declared at: clang/include/clang/Basic/SourceLocation.h:409

clang::FileID getFileID() const

Declared at: clang/include/clang/Basic/SourceLocation.h:387

clang::FullSourceLoc getFileLoc() const

Declared at: clang/include/clang/Basic/SourceLocation.h:391

unsigned int getFileOffset() const

Declared at: clang/include/clang/Basic/SourceLocation.h:396

clang::FullSourceLoc getImmediateMacroCallerLoc()
    const

Declared at: clang/include/clang/Basic/SourceLocation.h:394

unsigned int getLineNumber(
    bool* Invalid = nullptr) const

Declared at: clang/include/clang/Basic/SourceLocation.h:406

Parameters

bool* Invalid = nullptr

const clang::SourceManager& getManager() const

Declared at: clang/include/clang/Basic/SourceLocation.h:382

std::pair<FullSourceLoc, StringRef>
getModuleImportLoc() const

Declared at: clang/include/clang/Basic/SourceLocation.h:395

clang::PresumedLoc getPresumedLoc(
    bool UseLineDirectives = true) const

Declared at: clang/include/clang/Basic/SourceLocation.h:392

Parameters

bool UseLineDirectives = true

unsigned int getSpellingColumnNumber(
    bool* Invalid = nullptr) const

Declared at: clang/include/clang/Basic/SourceLocation.h:402

Parameters

bool* Invalid = nullptr

unsigned int getSpellingLineNumber(
    bool* Invalid = nullptr) const

Declared at: clang/include/clang/Basic/SourceLocation.h:401

Parameters

bool* Invalid = nullptr

clang::FullSourceLoc getSpellingLoc() const

Declared at: clang/include/clang/Basic/SourceLocation.h:390

bool hasManager() const

Description

Checks whether the SourceManager is present.

Declared at: clang/include/clang/Basic/SourceLocation.h:379

bool isBeforeInTranslationUnitThan(
    clang::SourceLocation Loc) const

Description

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

Declared at: clang/include/clang/Basic/SourceLocation.h:426

Parameters

clang::SourceLocation Loc

Returns

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

bool isBeforeInTranslationUnitThan(
    clang::FullSourceLoc Loc) const

Description

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

Declared at: clang/include/clang/Basic/SourceLocation.h:431

Parameters

clang::FullSourceLoc Loc

Returns

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

bool isInSystemHeader() const

Declared at: clang/include/clang/Basic/SourceLocation.h:421

bool isMacroArgExpansion(
    clang::FullSourceLoc* StartLoc =
        nullptr) const

Declared at: clang/include/clang/Basic/SourceLocation.h:393

Parameters

clang::FullSourceLoc* StartLoc = nullptr