clang 22.0.0git
clang::PresumedLoc Class Reference

Represents an unpacked "presumed" location which can be presented to the user. More...

#include "clang/Basic/SourceLocation.h"

Public Member Functions

 PresumedLoc ()=default
 PresumedLoc (const char *FN, FileID FID, unsigned Ln, unsigned Co, SourceLocation IL)
bool isInvalid () const
 Return true if this object is invalid or uninitialized.
bool isValid () const
const char * getFilename () const
 Return the presumed filename of this location.
FileID getFileID () const
unsigned getLine () const
 Return the presumed line number of this location.
unsigned getColumn () const
 Return the presumed column number of this location.
SourceLocation getIncludeLoc () const
 Return the presumed include location of this location.

Detailed Description

Represents an unpacked "presumed" location which can be presented to the user.

A 'presumed' location can be modified by #line and GNU line marker directives and is always the expansion point of a normal location.

You can get a PresumedLoc from a SourceLocation with SourceManager.

Definition at line 307 of file SourceLocation.h.

Constructor & Destructor Documentation

◆ PresumedLoc() [1/2]

clang::PresumedLoc::PresumedLoc ( )
default

◆ PresumedLoc() [2/2]

clang::PresumedLoc::PresumedLoc ( const char * FN,
FileID FID,
unsigned Ln,
unsigned Co,
SourceLocation IL )
inline

Definition at line 315 of file SourceLocation.h.

Member Function Documentation

◆ getColumn()

◆ getFileID()

FileID clang::PresumedLoc::getFileID ( ) const
inline

Definition at line 334 of file SourceLocation.h.

References isValid().

◆ getFilename()

const char * clang::PresumedLoc::getFilename ( ) const
inline

Return the presumed filename of this location.

This can be affected by #line etc.

Definition at line 329 of file SourceLocation.h.

References isValid().

Referenced by clang::DoPrintPreprocessedInput(), clang::TextNodeDumper::dumpLocation(), clang::CodeGen::CodeGenModule::EmitAnnotationUnit(), clang::DiagnosticNoteRenderer::emitBuildingModuleLocation(), clang::TextDiagnostic::emitBuildingModuleLocation(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::TextDiagnostic::emitDiagnosticLoc(), clang::DiagnosticNoteRenderer::emitImportLocation(), clang::TextDiagnostic::emitImportLocation(), clang::DiagnosticNoteRenderer::emitIncludeLocation(), clang::TextDiagnostic::emitIncludeLocation(), emitMappingInformation(), emitTargetTeamsLoopCodegenStatus(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::SourceLocExpr::EvaluateInContext(), getEntryInfoFromPresumedLoc(), getIdentStringFromSourceLocation(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CIRGen::CIRGenModule::getLoc(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::Preprocessor::HandlePragmaSystemHeader(), clang::SourceManager::isInPredefinedFile(), clang::SourceManager::isWrittenInBuiltinFile(), clang::SourceManager::isWrittenInCommandLineFile(), clang::SourceManager::isWrittenInScratchSpace(), clang::index::FileIndexRecord::print(), clang::SourceLocation::print(), PrintDifference(), clang::CodeGen::CodeGenModule::printPostfixForExternalizedDecl(), clang::printSourceLocationAsJson(), clang::Preprocessor::processPathToFileName(), and clang::extractapi::SymbolGraphSerializer::serializeSingleSymbolSGF().

◆ getIncludeLoc()

SourceLocation clang::PresumedLoc::getIncludeLoc ( ) const
inline

Return the presumed include location of this location.

This can be affected by GNU linemarker directives.

Definition at line 358 of file SourceLocation.h.

References isValid().

Referenced by ReadLineMarkerFlags().

◆ getLine()

◆ isInvalid()

◆ isValid()


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