本文整理汇总了C++中TextDiagnosticBuffer::note_begin方法的典型用法代码示例。如果您正苦于以下问题:C++ TextDiagnosticBuffer::note_begin方法的具体用法?C++ TextDiagnosticBuffer::note_begin怎么用?C++ TextDiagnosticBuffer::note_begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextDiagnosticBuffer
的用法示例。
在下文中一共展示了TextDiagnosticBuffer::note_begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckResults
/// CheckResults - This compares the expected results to those that
/// were actually reported. It emits any discrepencies. Return "true" if there
/// were problems. Return "false" otherwise.
static unsigned CheckResults(DiagnosticsEngine &Diags, SourceManager &SourceMgr,
const TextDiagnosticBuffer &Buffer,
ExpectedData &ED) {
// We want to capture the delta between what was expected and what was
// seen.
//
// Expected \ Seen - set expected but not seen
// Seen \ Expected - set seen but not expected
unsigned NumProblems = 0;
const DiagnosticLevelMask DiagMask =
Diags.getDiagnosticOptions().getVerifyIgnoreUnexpected();
// See if there are error mismatches.
NumProblems += CheckLists(Diags, SourceMgr, "error", ED.Errors,
Buffer.err_begin(), Buffer.err_end(),
bool(DiagnosticLevelMask::Error & DiagMask));
// See if there are warning mismatches.
NumProblems += CheckLists(Diags, SourceMgr, "warning", ED.Warnings,
Buffer.warn_begin(), Buffer.warn_end(),
bool(DiagnosticLevelMask::Warning & DiagMask));
// See if there are remark mismatches.
NumProblems += CheckLists(Diags, SourceMgr, "remark", ED.Remarks,
Buffer.remark_begin(), Buffer.remark_end(),
bool(DiagnosticLevelMask::Remark & DiagMask));
// See if there are note mismatches.
NumProblems += CheckLists(Diags, SourceMgr, "note", ED.Notes,
Buffer.note_begin(), Buffer.note_end(),
bool(DiagnosticLevelMask::Note & DiagMask));
return NumProblems;
}
示例2: CheckResults
/// This compares the expected results to those that were actually reported.
/// It emits any discrepencies. Return "true" if there were problems. Return
/// "false" otherwise.
static unsigned CheckResults(DiagnosticsEngine &Diags,
llvm::SourceMgr &SourceMgr,
const TextDiagnosticBuffer &Buffer,
ExpectedData &ED) {
// We want to capture the delta between what was expected and what was
// seen.
//
// Expected \ Seen - set expected but not seen
// Seen \ Expected - set seen but not expected
unsigned NumProblems = 0;
// See if there are error mismatches.
NumProblems += CheckLists(Diags, SourceMgr, "error", ED.Errors,
Buffer.err_begin(), Buffer.err_end());
// See if there are note mismatches.
NumProblems += CheckLists(Diags, SourceMgr, "note", ED.Notes,
Buffer.note_begin(), Buffer.note_end());
return NumProblems;
}