class DiagnosticInfoWithLocationBase

Declaration

class DiagnosticInfoWithLocationBase : public DiagnosticInfo { /* full declaration omitted */ };

Description

Common features for diagnostics with an associated location.

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:374

Inherits from: DiagnosticInfo

Member Variables

private const llvm::Function& Fn
Function where this diagnostic is triggered.
private llvm::DiagnosticLocation Loc
Debug location where this diagnostic is triggered.

Method Overview

Inherited from DiagnosticInfo:

Methods

DiagnosticInfoWithLocationBase(
    enum DiagnosticKind Kind,
    enum DiagnosticSeverity Severity,
    const llvm::Function& Fn,
    const llvm::DiagnosticLocation& Loc)

Description

\p Fn is the function where the diagnostic is being emitted. \p Loc is the location information to use in the diagnostic.

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:379

Parameters

enum DiagnosticKind Kind
enum DiagnosticSeverity Severity
const llvm::Function& Fn
const llvm::DiagnosticLocation& Loc

void anchor()

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:375

std::string getAbsolutePath() const

Description

Return the absolute path tot the file.

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:399

const llvm::Function& getFunction() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:401

void getLocation(llvm::StringRef& RelativePath,
                 unsigned int& Line,
                 unsigned int& Column) const

Description

Return location information for this diagnostic in three parts: the relative source file path, line number and column.

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:395

Parameters

llvm::StringRef& RelativePath
unsigned int& Line
unsigned int& Column

llvm::DiagnosticLocation getLocation() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:402

std::string getLocationStr() const

Description

Return a string with the location information for this diagnostic in the format "file:line:col". If location information is not available, it returns "<unknown>:0:0".

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:391

bool isLocationAvailable() const

Description

Return true if location information is available for this diagnostic.

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:386