You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
7 months ago
|
//===- DiagnosticPrinter.cpp ----------------------------------------------===//
|
||
|
//
|
||
|
// The MCLinker Project
|
||
|
//
|
||
|
// This file is distributed under the University of Illinois Open Source
|
||
|
// License. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
#include "mcld/LD/DiagnosticPrinter.h"
|
||
|
|
||
|
namespace mcld {
|
||
|
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
// DiagnosticPrinter
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
DiagnosticPrinter::DiagnosticPrinter() : m_NumErrors(0), m_NumWarnings(0) {
|
||
|
}
|
||
|
|
||
|
DiagnosticPrinter::~DiagnosticPrinter() {
|
||
|
clear();
|
||
|
}
|
||
|
|
||
|
/// HandleDiagnostic - Handle this diagnostic, reporting it to the user or
|
||
|
/// capturing it to a log as needed.
|
||
|
void DiagnosticPrinter::handleDiagnostic(DiagnosticEngine::Severity pSeverity,
|
||
|
const Diagnostic& pInfo) {
|
||
|
if (pSeverity == DiagnosticEngine::Warning)
|
||
|
++m_NumWarnings;
|
||
|
|
||
|
if (pSeverity <= DiagnosticEngine::Error)
|
||
|
++m_NumErrors;
|
||
|
}
|
||
|
|
||
|
} // namespace mcld
|