本文整理汇总了C++中DirectiveList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ DirectiveList::size方法的具体用法?C++ DirectiveList::size怎么用?C++ DirectiveList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DirectiveList
的用法示例。
在下文中一共展示了DirectiveList::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintExpected
/// \brief Takes a list of diagnostics that were expected to have been generated
/// but were not and produces a diagnostic to the user from this.
static unsigned PrintExpected(DiagnosticsEngine &Diags, const llvm::SourceMgr &SourceMgr,
DirectiveList &DL, DiagnosticsEngine::Level Kind) {
if (DL.empty())
return 0;
for (DirectiveList::iterator I = DL.begin(), E = DL.end(); I != E; ++I) {
Directive &D = **I;
Diags.ReportError(D.DirectiveLoc,llvm::Twine("Inconsistend verify directive: ")+D.Text);
}
return DL.size();
}
示例2: PrintProblem
static unsigned PrintProblem(Diagnostic &Diags, SourceManager *SourceMgr,
DirectiveList &DL, const char *Kind,
bool Expected) {
if (DL.empty())
return 0;
llvm::SmallString<256> Fmt;
llvm::raw_svector_ostream OS(Fmt);
for (DirectiveList::iterator I = DL.begin(), E = DL.end(); I != E; ++I) {
Directive& D = **I;
if (D.Location.isInvalid() || !SourceMgr)
OS << "\n (frontend)";
else
OS << "\n Line " << SourceMgr->getInstantiationLineNumber(D.Location);
OS << ": " << D.Text;
}
Diags.Report(diag::err_verify_inconsistent_diags)
<< Kind << !Expected << OS.str();
return DL.size();
}
示例3: PrintExpected
/// \brief Takes a list of diagnostics that were expected to have been generated
/// but were not and produces a diagnostic to the user from this.
static unsigned PrintExpected(DiagnosticsEngine &Diags, SourceManager &SourceMgr,
DirectiveList &DL, const char *Kind) {
if (DL.empty())
return 0;
SmallString<256> Fmt;
llvm::raw_svector_ostream OS(Fmt);
for (DirectiveList::iterator I = DL.begin(), E = DL.end(); I != E; ++I) {
Directive &D = **I;
OS << "\n Line " << SourceMgr.getPresumedLineNumber(D.DiagnosticLoc);
if (D.DirectiveLoc != D.DiagnosticLoc)
OS << " (directive at "
<< SourceMgr.getFilename(D.DirectiveLoc) << ":"
<< SourceMgr.getPresumedLineNumber(D.DirectiveLoc) << ")";
OS << ": " << D.Text;
}
Diags.Report(diag::err_verify_inconsistent_diags).setForceEmit()
<< Kind << /*Unexpected=*/false << OS.str();
return DL.size();
}
示例4: PrintExpected
/// \brief Takes a list of diagnostics that were expected to have been generated
/// but were not and produces a diagnostic to the user from this.
static unsigned PrintExpected(DiagnosticsEngine &Diags, llvm::SourceMgr &SourceMgr,
DirectiveList &DL, const char *Kind) {
if (DL.empty())
return 0;
SmallString<256> Fmt;
llvm::raw_svector_ostream OS(Fmt);
for (DirectiveList::iterator I = DL.begin(), E = DL.end(); I != E; ++I) {
Directive &D = **I;
OS << "\n Line " << SourceMgr.getLineAndColumn(D.DiagnosticLoc).first;
if (D.DirectiveLoc != D.DiagnosticLoc) {
int BufID = SourceMgr.FindBufferContainingLoc(D.DirectiveLoc);
OS << " (directive at "
<< SourceMgr.getMemoryBuffer(BufID)->getBufferIdentifier()
<< SourceMgr.getLineAndColumn(D.DirectiveLoc).first << ")";
}
OS << ": " << D.Text;
}
Diags.Report(SourceLocation(), diag::verify_inconsistent_diags)
<< Kind << /*Unexpected=*/false << OS.str();
return DL.size();
}