本文整理汇总了C++中DiagnosticEngine::getPrinter方法的典型用法代码示例。如果您正苦于以下问题:C++ DiagnosticEngine::getPrinter方法的具体用法?C++ DiagnosticEngine::getPrinter怎么用?C++ DiagnosticEngine::getPrinter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiagnosticEngine
的用法示例。
在下文中一共展示了DiagnosticEngine::getPrinter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
bool DiagnosticInfos::process(DiagnosticEngine& pEngine) const {
Diagnostic info(pEngine);
unsigned int ID = info.getID();
// we are not implement LineInfo, so keep pIsLoC false.
const DiagStaticInfo* static_info = getDiagInfo(ID);
DiagnosticEngine::Severity severity = static_info->Severity;
switch (ID) {
case diag::multiple_definitions: {
if (m_Config.options().isMulDefs()) {
severity = DiagnosticEngine::Ignore;
}
break;
}
case diag::undefined_reference:
case diag::undefined_reference_text: {
// we have not implement --unresolved-symbols=method yet. So far, MCLinker
// provides the easier --allow-shlib-undefined and --no-undefined (i.e.
// -z defs)
switch (m_Config.codeGenType()) {
case LinkerConfig::Object:
if (m_Config.options().isNoUndefined())
severity = DiagnosticEngine::Error;
else
severity = DiagnosticEngine::Ignore;
break;
case LinkerConfig::DynObj:
if (m_Config.options().isNoUndefined())
severity = DiagnosticEngine::Error;
else
severity = DiagnosticEngine::Ignore;
break;
default:
severity = DiagnosticEngine::Error;
break;
}
break;
}
case diag::debug_print_gc_sections: {
if (!m_Config.options().getPrintGCSections())
severity = DiagnosticEngine::Ignore;
break;
}
default:
break;
} // end of switch
// If --fatal-warnings is turned on, then switch warnings and errors to fatal
if (m_Config.options().isFatalWarnings()) {
if (severity == DiagnosticEngine::Warning ||
severity == DiagnosticEngine::Error) {
severity = DiagnosticEngine::Fatal;
}
}
// finally, report it.
pEngine.getPrinter()->handleDiagnostic(severity, info);
return true;
}