clang  12.0.0git
Public Member Functions | Public Attributes | List of all members
clang::tooling::DiagnosticMessage Struct Reference

Represents the diagnostic message with the error message associated and the information on the location of the problem. More...

#include "clang/Tooling/Core/Diagnostic.h"

Collaboration diagram for clang::tooling::DiagnosticMessage:
Collaboration graph
[legend]

Public Member Functions

 DiagnosticMessage (llvm::StringRef Message="")
 
 DiagnosticMessage (llvm::StringRef Message, const SourceManager &Sources, SourceLocation Loc)
 Constructs a diagnostic message with anoffset to the diagnostic within the file where the problem occurred. More...
 

Public Attributes

std::string Message
 
std::string FilePath
 
unsigned FileOffset
 
llvm::StringMap< ReplacementsFix
 Fixes for this diagnostic, grouped by file path. More...
 

Detailed Description

Represents the diagnostic message with the error message associated and the information on the location of the problem.

Definition at line 31 of file Diagnostic.h.

Constructor & Destructor Documentation

◆ DiagnosticMessage() [1/2]

clang::tooling::DiagnosticMessage::DiagnosticMessage ( llvm::StringRef  Message = "")

Definition at line 21 of file Diagnostic.cpp.

◆ DiagnosticMessage() [2/2]

clang::tooling::DiagnosticMessage::DiagnosticMessage ( llvm::StringRef  Message,
const SourceManager Sources,
SourceLocation  Loc 
)

Constructs a diagnostic message with anoffset to the diagnostic within the file where the problem occurred.

Parameters
LocShould be a file location, it is not meaningful for a macro location.

Definition at line 24 of file Diagnostic.cpp.

References FileOffset, FilePath, clang::SourceManager::getFilename(), clang::SourceManager::getFileOffset(), clang::SourceLocation::isFileID(), and clang::SourceLocation::isValid().

Member Data Documentation

◆ FileOffset

unsigned clang::tooling::DiagnosticMessage::FileOffset

◆ FilePath

std::string clang::tooling::DiagnosticMessage::FilePath

◆ Fix

llvm::StringMap<Replacements> clang::tooling::DiagnosticMessage::Fix

Fixes for this diagnostic, grouped by file path.

Definition at line 47 of file Diagnostic.h.

Referenced by llvm::yaml::MappingTraits< clang::tooling::DiagnosticMessage >::mapping(), and clang::tooling::selectFirstFix().

◆ Message

std::string clang::tooling::DiagnosticMessage::Message

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