2008-03-27 11:49:32 +08:00
|
|
|
//===--- PathDiagnostic.cpp - Path-Specific Diagnostic Handling -*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the PathDiagnostic-related interfaces.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-02-10 09:03:03 +08:00
|
|
|
#include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"
|
2011-09-14 08:25:17 +08:00
|
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
|
2009-03-27 05:39:39 +08:00
|
|
|
#include "clang/AST/Expr.h"
|
2009-04-07 06:33:35 +08:00
|
|
|
#include "clang/AST/Decl.h"
|
|
|
|
#include "clang/AST/DeclObjC.h"
|
2011-09-15 01:48:01 +08:00
|
|
|
#include "clang/AST/ParentMap.h"
|
2009-04-27 04:35:05 +08:00
|
|
|
#include "clang/AST/StmtCXX.h"
|
2008-11-19 14:51:40 +08:00
|
|
|
#include "llvm/ADT/SmallString.h"
|
2009-06-26 08:43:22 +08:00
|
|
|
|
2008-03-27 11:49:32 +08:00
|
|
|
using namespace clang;
|
2010-12-23 15:20:52 +08:00
|
|
|
using namespace ento;
|
2009-03-10 13:16:17 +08:00
|
|
|
|
|
|
|
bool PathDiagnosticMacroPiece::containsEvent() const {
|
|
|
|
for (const_iterator I = begin(), E = end(); I!=E; ++I) {
|
|
|
|
if (isa<PathDiagnosticEventPiece>(*I))
|
|
|
|
return true;
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-10 13:16:17 +08:00
|
|
|
if (PathDiagnosticMacroPiece *MP = dyn_cast<PathDiagnosticMacroPiece>(*I))
|
|
|
|
if (MP->containsEvent())
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2009-02-27 05:30:32 +08:00
|
|
|
|
2011-07-23 18:55:15 +08:00
|
|
|
static StringRef StripTrailingDots(StringRef s) {
|
|
|
|
for (StringRef::size_type i = s.size(); i != 0; --i)
|
2009-12-12 05:09:27 +08:00
|
|
|
if (s[i - 1] != '.')
|
|
|
|
return s.substr(0, i);
|
|
|
|
return "";
|
2009-02-27 05:30:32 +08:00
|
|
|
}
|
|
|
|
|
2011-07-23 18:55:15 +08:00
|
|
|
PathDiagnosticPiece::PathDiagnosticPiece(StringRef s,
|
2009-03-03 03:39:50 +08:00
|
|
|
Kind k, DisplayHint hint)
|
2009-12-12 05:09:27 +08:00
|
|
|
: str(StripTrailingDots(s)), kind(k), Hint(hint) {}
|
2009-03-06 15:53:30 +08:00
|
|
|
|
2009-03-27 05:21:35 +08:00
|
|
|
PathDiagnosticPiece::PathDiagnosticPiece(Kind k, DisplayHint hint)
|
|
|
|
: kind(k), Hint(hint) {}
|
2009-03-13 02:41:53 +08:00
|
|
|
|
2009-03-07 06:10:49 +08:00
|
|
|
PathDiagnosticPiece::~PathDiagnosticPiece() {}
|
2009-03-07 07:58:11 +08:00
|
|
|
PathDiagnosticEventPiece::~PathDiagnosticEventPiece() {}
|
|
|
|
PathDiagnosticControlFlowPiece::~PathDiagnosticControlFlowPiece() {}
|
2009-03-07 06:10:49 +08:00
|
|
|
|
|
|
|
PathDiagnosticMacroPiece::~PathDiagnosticMacroPiece() {
|
|
|
|
for (iterator I = begin(), E = end(); I != E; ++I) delete *I;
|
|
|
|
}
|
|
|
|
|
2009-03-06 15:53:30 +08:00
|
|
|
PathDiagnostic::PathDiagnostic() : Size(0) {}
|
2009-02-27 05:30:32 +08:00
|
|
|
|
2008-03-27 11:49:32 +08:00
|
|
|
PathDiagnostic::~PathDiagnostic() {
|
|
|
|
for (iterator I = begin(), E = end(); I != E; ++I) delete &*I;
|
|
|
|
}
|
|
|
|
|
2009-03-10 13:16:17 +08:00
|
|
|
void PathDiagnostic::resetPath(bool deletePieces) {
|
|
|
|
Size = 0;
|
|
|
|
|
|
|
|
if (deletePieces)
|
|
|
|
for (iterator I=begin(), E=end(); I!=E; ++I)
|
|
|
|
delete &*I;
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-10 13:16:17 +08:00
|
|
|
path.clear();
|
|
|
|
}
|
|
|
|
|
2009-03-06 15:08:50 +08:00
|
|
|
|
2011-07-23 18:55:15 +08:00
|
|
|
PathDiagnostic::PathDiagnostic(StringRef bugtype, StringRef desc,
|
|
|
|
StringRef category)
|
2009-03-06 15:53:30 +08:00
|
|
|
: Size(0),
|
2009-12-12 05:09:27 +08:00
|
|
|
BugType(StripTrailingDots(bugtype)),
|
|
|
|
Desc(StripTrailingDots(desc)),
|
|
|
|
Category(StripTrailingDots(category)) {}
|
2009-03-06 15:08:50 +08:00
|
|
|
|
2011-09-26 08:51:36 +08:00
|
|
|
void PathDiagnosticConsumer::HandlePathDiagnostic(const PathDiagnostic *D) {
|
2011-08-28 05:39:14 +08:00
|
|
|
// For now this simply forwards to HandlePathDiagnosticImpl. In the future
|
|
|
|
// we can use this indirection to control for multi-threaded access to
|
2011-09-26 08:51:36 +08:00
|
|
|
// the PathDiagnosticConsumer from multiple bug reporters.
|
2011-08-28 05:39:14 +08:00
|
|
|
HandlePathDiagnosticImpl(D);
|
|
|
|
}
|
|
|
|
|
2009-03-27 05:39:39 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// PathDiagnosticLocation methods.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-09-17 03:18:30 +08:00
|
|
|
static SourceLocation getValidSourceLocation(const Stmt* S,
|
2011-09-21 02:23:52 +08:00
|
|
|
LocationOrAnalysisContext LAC) {
|
2011-09-17 03:18:30 +08:00
|
|
|
SourceLocation L = S->getLocStart();
|
2011-09-21 02:23:52 +08:00
|
|
|
assert(!LAC.isNull() && "A valid LocationContext or AnalysisContext should "
|
|
|
|
"be passed to PathDiagnosticLocation upon creation.");
|
2011-09-17 03:18:30 +08:00
|
|
|
|
|
|
|
// S might be a temporary statement that does not have a location in the
|
|
|
|
// source code, so find an enclosing statement and use it's location.
|
2011-09-21 00:37:36 +08:00
|
|
|
if (!L.isValid()) {
|
2011-09-21 02:23:52 +08:00
|
|
|
|
|
|
|
ParentMap *PM = 0;
|
|
|
|
if (LAC.is<const LocationContext*>())
|
|
|
|
PM = &LAC.get<const LocationContext*>()->getParentMap();
|
|
|
|
else
|
|
|
|
PM = &LAC.get<AnalysisContext*>()->getParentMap();
|
2011-09-21 00:37:36 +08:00
|
|
|
|
|
|
|
while (!L.isValid()) {
|
2011-09-21 02:23:52 +08:00
|
|
|
S = PM->getParent(S);
|
2011-09-21 00:37:36 +08:00
|
|
|
L = S->getLocStart();
|
|
|
|
}
|
2011-09-17 03:18:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return L;
|
|
|
|
}
|
|
|
|
|
|
|
|
PathDiagnosticLocation
|
2011-09-21 05:38:35 +08:00
|
|
|
PathDiagnosticLocation::createBegin(const Decl *D,
|
|
|
|
const SourceManager &SM) {
|
|
|
|
return PathDiagnosticLocation(D->getLocStart(), SM, SingleLocK);
|
|
|
|
}
|
|
|
|
|
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::createBegin(const Stmt *S,
|
|
|
|
const SourceManager &SM,
|
|
|
|
LocationOrAnalysisContext LAC) {
|
2011-09-21 02:23:52 +08:00
|
|
|
return PathDiagnosticLocation(getValidSourceLocation(S, LAC),
|
2011-09-20 09:51:40 +08:00
|
|
|
SM, SingleLocK);
|
2011-09-17 03:18:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::createOperatorLoc(const BinaryOperator *BO,
|
|
|
|
const SourceManager &SM) {
|
|
|
|
return PathDiagnosticLocation(BO->getOperatorLoc(), SM, SingleLocK);
|
|
|
|
}
|
|
|
|
|
2011-09-21 05:38:35 +08:00
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::createMemberLoc(const MemberExpr *ME,
|
|
|
|
const SourceManager &SM) {
|
|
|
|
return PathDiagnosticLocation(ME->getMemberLoc(), SM, SingleLocK);
|
|
|
|
}
|
|
|
|
|
2011-09-17 03:18:30 +08:00
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::createBeginBrace(const CompoundStmt *CS,
|
|
|
|
const SourceManager &SM) {
|
|
|
|
SourceLocation L = CS->getLBracLoc();
|
|
|
|
return PathDiagnosticLocation(L, SM, SingleLocK);
|
|
|
|
}
|
|
|
|
|
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::createEndBrace(const CompoundStmt *CS,
|
|
|
|
const SourceManager &SM) {
|
|
|
|
SourceLocation L = CS->getRBracLoc();
|
|
|
|
return PathDiagnosticLocation(L, SM, SingleLocK);
|
|
|
|
}
|
|
|
|
|
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::createDeclBegin(const LocationContext *LC,
|
|
|
|
const SourceManager &SM) {
|
|
|
|
// FIXME: Should handle CXXTryStmt if analyser starts supporting C++.
|
|
|
|
if (const CompoundStmt *CS =
|
|
|
|
dyn_cast_or_null<CompoundStmt>(LC->getDecl()->getBody()))
|
|
|
|
if (!CS->body_empty()) {
|
|
|
|
SourceLocation Loc = (*CS->body_begin())->getLocStart();
|
|
|
|
return PathDiagnosticLocation(Loc, SM, SingleLocK);
|
|
|
|
}
|
|
|
|
|
|
|
|
return PathDiagnosticLocation();
|
|
|
|
}
|
|
|
|
|
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::createDeclEnd(const LocationContext *LC,
|
2011-09-20 09:38:47 +08:00
|
|
|
const SourceManager &SM) {
|
2011-09-16 02:56:07 +08:00
|
|
|
SourceLocation L = LC->getDecl()->getBodyRBrace();
|
2011-09-17 03:18:30 +08:00
|
|
|
return PathDiagnosticLocation(L, SM, SingleLocK);
|
2011-09-16 02:56:07 +08:00
|
|
|
}
|
|
|
|
|
2011-09-20 09:38:47 +08:00
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::create(const ProgramPoint& P,
|
|
|
|
const SourceManager &SMng) {
|
2011-09-16 02:56:07 +08:00
|
|
|
|
2011-09-20 09:38:47 +08:00
|
|
|
const Stmt* S = 0;
|
2011-09-16 02:56:07 +08:00
|
|
|
if (const BlockEdge *BE = dyn_cast<BlockEdge>(&P)) {
|
|
|
|
const CFGBlock *BSrc = BE->getSrc();
|
|
|
|
S = BSrc->getTerminatorCondition();
|
|
|
|
}
|
|
|
|
else if (const PostStmt *PS = dyn_cast<PostStmt>(&P)) {
|
|
|
|
S = PS->getStmt();
|
|
|
|
}
|
|
|
|
|
2011-09-20 09:38:47 +08:00
|
|
|
return PathDiagnosticLocation(S, SMng, P.getLocationContext());
|
|
|
|
|
2011-09-16 02:56:07 +08:00
|
|
|
if (!S)
|
2011-09-20 09:38:47 +08:00
|
|
|
return PathDiagnosticLocation();
|
2011-09-16 02:56:07 +08:00
|
|
|
}
|
|
|
|
|
2011-09-17 03:18:30 +08:00
|
|
|
PathDiagnosticLocation
|
|
|
|
PathDiagnosticLocation::createEndOfPath(const ExplodedNode* N,
|
|
|
|
const SourceManager &SM) {
|
2011-09-14 08:25:17 +08:00
|
|
|
assert(N && "Cannot create a location with a null node.");
|
|
|
|
|
|
|
|
const ExplodedNode *NI = N;
|
|
|
|
|
|
|
|
while (NI) {
|
|
|
|
ProgramPoint P = NI->getLocation();
|
2011-09-15 01:48:01 +08:00
|
|
|
const LocationContext *LC = P.getLocationContext();
|
2011-09-20 09:38:47 +08:00
|
|
|
if (const StmtPoint *PS = dyn_cast<StmtPoint>(&P))
|
2011-09-15 01:48:01 +08:00
|
|
|
return PathDiagnosticLocation(PS->getStmt(), SM, LC);
|
2011-09-14 08:25:17 +08:00
|
|
|
else if (const BlockEdge *BE = dyn_cast<BlockEdge>(&P)) {
|
|
|
|
const Stmt *Term = BE->getSrc()->getTerminator();
|
|
|
|
assert(Term);
|
2011-09-15 01:48:01 +08:00
|
|
|
return PathDiagnosticLocation(Term, SM, LC);
|
2011-09-14 08:25:17 +08:00
|
|
|
}
|
|
|
|
NI = NI->succ_empty() ? 0 : *(NI->succ_begin());
|
|
|
|
}
|
|
|
|
|
2011-09-17 03:18:30 +08:00
|
|
|
return createDeclEnd(N->getLocationContext(), SM);
|
2011-09-15 01:48:01 +08:00
|
|
|
}
|
|
|
|
|
2011-09-20 09:38:47 +08:00
|
|
|
PathDiagnosticLocation PathDiagnosticLocation::createSingleLocation(
|
|
|
|
const PathDiagnosticLocation &PDL) {
|
|
|
|
FullSourceLoc L = PDL.asLocation();
|
|
|
|
return PathDiagnosticLocation(L, L.getManager(), SingleLocK);
|
|
|
|
}
|
|
|
|
|
2011-09-20 09:51:40 +08:00
|
|
|
FullSourceLoc
|
2011-09-21 08:35:58 +08:00
|
|
|
PathDiagnosticLocation::genLocation(SourceLocation L,
|
|
|
|
LocationOrAnalysisContext LAC) const {
|
2009-04-01 14:13:56 +08:00
|
|
|
assert(isValid());
|
2009-03-27 05:42:51 +08:00
|
|
|
// Note that we want a 'switch' here so that the compiler can warn us in
|
|
|
|
// case we add more cases.
|
2009-03-27 05:39:39 +08:00
|
|
|
switch (K) {
|
2009-04-07 06:33:35 +08:00
|
|
|
case SingleLocK:
|
|
|
|
case RangeK:
|
2009-03-27 05:42:00 +08:00
|
|
|
break;
|
2009-04-07 06:33:35 +08:00
|
|
|
case StmtK:
|
2011-09-21 02:23:52 +08:00
|
|
|
return FullSourceLoc(getValidSourceLocation(S, LAC),
|
2011-09-15 01:48:01 +08:00
|
|
|
const_cast<SourceManager&>(*SM));
|
2009-04-07 06:33:35 +08:00
|
|
|
case DeclK:
|
|
|
|
return FullSourceLoc(D->getLocation(), const_cast<SourceManager&>(*SM));
|
2009-03-27 05:39:39 +08:00
|
|
|
}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2011-09-21 07:27:32 +08:00
|
|
|
return FullSourceLoc(L, const_cast<SourceManager&>(*SM));
|
2009-03-27 05:39:39 +08:00
|
|
|
}
|
2009-03-27 05:48:17 +08:00
|
|
|
|
2011-09-20 09:51:40 +08:00
|
|
|
PathDiagnosticRange
|
2011-09-21 08:35:58 +08:00
|
|
|
PathDiagnosticLocation::genRange(LocationOrAnalysisContext LAC) const {
|
2009-04-01 14:13:56 +08:00
|
|
|
assert(isValid());
|
2009-03-27 05:48:17 +08:00
|
|
|
// Note that we want a 'switch' here so that the compiler can warn us in
|
|
|
|
// case we add more cases.
|
|
|
|
switch (K) {
|
2009-04-07 06:33:35 +08:00
|
|
|
case SingleLocK:
|
2011-09-21 08:35:58 +08:00
|
|
|
return PathDiagnosticRange(SourceRange(Loc,Loc), true);
|
2009-04-07 06:33:35 +08:00
|
|
|
case RangeK:
|
2009-03-27 05:48:17 +08:00
|
|
|
break;
|
2009-04-23 02:03:00 +08:00
|
|
|
case StmtK: {
|
|
|
|
const Stmt *S = asStmt();
|
|
|
|
switch (S->getStmtClass()) {
|
|
|
|
default:
|
|
|
|
break;
|
2009-05-15 10:05:25 +08:00
|
|
|
case Stmt::DeclStmtClass: {
|
|
|
|
const DeclStmt *DS = cast<DeclStmt>(S);
|
|
|
|
if (DS->isSingleDecl()) {
|
|
|
|
// Should always be the case, but we'll be defensive.
|
|
|
|
return SourceRange(DS->getLocStart(),
|
2009-09-09 23:08:12 +08:00
|
|
|
DS->getSingleDecl()->getLocation());
|
2009-05-15 10:05:25 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2009-04-23 02:03:00 +08:00
|
|
|
// FIXME: Provide better range information for different
|
|
|
|
// terminators.
|
|
|
|
case Stmt::IfStmtClass:
|
|
|
|
case Stmt::WhileStmtClass:
|
|
|
|
case Stmt::DoStmtClass:
|
|
|
|
case Stmt::ForStmtClass:
|
|
|
|
case Stmt::ChooseExprClass:
|
|
|
|
case Stmt::IndirectGotoStmtClass:
|
|
|
|
case Stmt::SwitchStmtClass:
|
2011-02-17 18:25:35 +08:00
|
|
|
case Stmt::BinaryConditionalOperatorClass:
|
2009-04-23 02:03:00 +08:00
|
|
|
case Stmt::ConditionalOperatorClass:
|
|
|
|
case Stmt::ObjCForCollectionStmtClass: {
|
2011-09-21 02:23:52 +08:00
|
|
|
SourceLocation L = getValidSourceLocation(S, LAC);
|
2009-04-23 02:03:00 +08:00
|
|
|
return SourceRange(L, L);
|
|
|
|
}
|
|
|
|
}
|
2011-09-21 08:35:58 +08:00
|
|
|
SourceRange R = S->getSourceRange();
|
|
|
|
if (R.isValid())
|
|
|
|
return R;
|
|
|
|
break;
|
2009-04-23 02:03:00 +08:00
|
|
|
}
|
2009-04-07 06:33:35 +08:00
|
|
|
case DeclK:
|
|
|
|
if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D))
|
|
|
|
return MD->getSourceRange();
|
2009-04-18 08:02:19 +08:00
|
|
|
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
|
2010-07-07 20:24:14 +08:00
|
|
|
if (Stmt *Body = FD->getBody())
|
|
|
|
return Body->getSourceRange();
|
2009-04-18 08:02:19 +08:00
|
|
|
}
|
2009-04-07 06:33:35 +08:00
|
|
|
else {
|
|
|
|
SourceLocation L = D->getLocation();
|
2009-04-23 06:26:10 +08:00
|
|
|
return PathDiagnosticRange(SourceRange(L, L), true);
|
2009-04-07 06:33:35 +08:00
|
|
|
}
|
2009-03-27 05:48:17 +08:00
|
|
|
}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2011-09-21 08:35:58 +08:00
|
|
|
return SourceRange(Loc,Loc);
|
2009-03-27 05:48:17 +08:00
|
|
|
}
|
|
|
|
|
2009-04-07 06:33:35 +08:00
|
|
|
void PathDiagnosticLocation::flatten() {
|
|
|
|
if (K == StmtK) {
|
|
|
|
K = RangeK;
|
|
|
|
S = 0;
|
|
|
|
D = 0;
|
|
|
|
}
|
|
|
|
else if (K == DeclK) {
|
|
|
|
K = SingleLocK;
|
|
|
|
S = 0;
|
|
|
|
D = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-19 06:33:39 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FoldingSet profiling methods.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
void PathDiagnosticLocation::Profile(llvm::FoldingSetNodeID &ID) const {
|
2011-09-21 05:25:00 +08:00
|
|
|
ID.AddInteger(Range.getBegin().getRawEncoding());
|
|
|
|
ID.AddInteger(Range.getEnd().getRawEncoding());
|
|
|
|
ID.AddInteger(Loc.getRawEncoding());
|
2009-09-19 06:33:39 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PathDiagnosticPiece::Profile(llvm::FoldingSetNodeID &ID) const {
|
|
|
|
ID.AddInteger((unsigned) getKind());
|
|
|
|
ID.AddString(str);
|
|
|
|
// FIXME: Add profiling support for code hints.
|
|
|
|
ID.AddInteger((unsigned) getDisplayHint());
|
|
|
|
for (range_iterator I = ranges_begin(), E = ranges_end(); I != E; ++I) {
|
|
|
|
ID.AddInteger(I->getBegin().getRawEncoding());
|
|
|
|
ID.AddInteger(I->getEnd().getRawEncoding());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PathDiagnosticSpotPiece::Profile(llvm::FoldingSetNodeID &ID) const {
|
|
|
|
PathDiagnosticPiece::Profile(ID);
|
|
|
|
ID.Add(Pos);
|
|
|
|
}
|
2009-04-07 06:33:35 +08:00
|
|
|
|
2009-09-19 06:33:39 +08:00
|
|
|
void PathDiagnosticControlFlowPiece::Profile(llvm::FoldingSetNodeID &ID) const {
|
|
|
|
PathDiagnosticPiece::Profile(ID);
|
|
|
|
for (const_iterator I = begin(), E = end(); I != E; ++I)
|
|
|
|
ID.Add(*I);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PathDiagnosticMacroPiece::Profile(llvm::FoldingSetNodeID &ID) const {
|
|
|
|
PathDiagnosticSpotPiece::Profile(ID);
|
|
|
|
for (const_iterator I = begin(), E = end(); I != E; ++I)
|
|
|
|
ID.Add(**I);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PathDiagnostic::Profile(llvm::FoldingSetNodeID &ID) const {
|
|
|
|
ID.AddInteger(Size);
|
|
|
|
ID.AddString(BugType);
|
|
|
|
ID.AddString(Desc);
|
|
|
|
ID.AddString(Category);
|
|
|
|
for (const_iterator I = begin(), E = end(); I != E; ++I)
|
|
|
|
ID.Add(*I);
|
|
|
|
|
|
|
|
for (meta_iterator I = meta_begin(), E = meta_end(); I != E; ++I)
|
|
|
|
ID.AddString(*I);
|
|
|
|
}
|