本文整理汇总了C++中PathDiagnostic::getUniqueingLoc方法的典型用法代码示例。如果您正苦于以下问题:C++ PathDiagnostic::getUniqueingLoc方法的具体用法?C++ PathDiagnostic::getUniqueingLoc怎么用?C++ PathDiagnostic::getUniqueingLoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathDiagnostic
的用法示例。
在下文中一共展示了PathDiagnostic::getUniqueingLoc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReportDiag
//.........这里部分代码省略.........
<< "<a href=\"#Note" << NumExtraPieces << "\">line "
<< LineNumber << ", column " << ColumnNumber << "</a><br />"
<< P->getString() << "</td></tr>";
++NumExtraPieces;
}
}
// Output any other meta data.
for (PathDiagnostic::meta_iterator I=D.meta_begin(), E=D.meta_end();
I!=E; ++I) {
os << "<tr><td></td><td>" << html::EscapeText(*I) << "</td></tr>\n";
}
os << "</table>\n<!-- REPORTSUMMARYEXTRA -->\n"
"<h3>Annotated Source Code</h3>\n";
R.InsertTextBefore(SMgr.getLocForStartOfFile(FID), os.str());
}
// Embed meta-data tags.
{
std::string s;
llvm::raw_string_ostream os(s);
StringRef BugDesc = D.getVerboseDescription();
if (!BugDesc.empty())
os << "\n<!-- BUGDESC " << BugDesc << " -->\n";
StringRef BugType = D.getBugType();
if (!BugType.empty())
os << "\n<!-- BUGTYPE " << BugType << " -->\n";
PathDiagnosticLocation UPDLoc = D.getUniqueingLoc();
FullSourceLoc L(SMgr.getExpansionLoc(UPDLoc.isValid()
? UPDLoc.asLocation()
: D.getLocation().asLocation()),
SMgr);
const Decl *DeclWithIssue = D.getDeclWithIssue();
StringRef BugCategory = D.getCategory();
if (!BugCategory.empty())
os << "\n<!-- BUGCATEGORY " << BugCategory << " -->\n";
os << "\n<!-- BUGFILE " << DirName << Entry->getName() << " -->\n";
os << "\n<!-- FILENAME " << llvm::sys::path::filename(Entry->getName()) << " -->\n";
os << "\n<!-- FUNCTIONNAME " << declName << " -->\n";
os << "\n<!-- ISSUEHASHCONTENTOFLINEINCONTEXT "
<< GetIssueHash(SMgr, L, D.getCheckName(), D.getBugType(), DeclWithIssue,
PP.getLangOpts()) << " -->\n";
os << "\n<!-- BUGLINE "
<< LineNumber
<< " -->\n";
os << "\n<!-- BUGCOLUMN "
<< ColumnNumber
<< " -->\n";
os << "\n<!-- BUGPATHLENGTH " << path.size() << " -->\n";
// Mark the end of the tags.
os << "\n<!-- BUGMETAEND -->\n";