[analyzer] Rename 'EmitReport' to 'emitReport'.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167275 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jordan Rose 2012-11-02 01:53:40 +00:00
Родитель 80a8eb76a0
Коммит 785950e594
44 изменённых файлов: 83 добавлений и 83 удалений

Просмотреть файл

@ -450,7 +450,7 @@ public:
/// The reports are usually generated by the checkers. Further, they are /// The reports are usually generated by the checkers. Further, they are
/// folded based on the profile value, which is done to coalesce similar /// folded based on the profile value, which is done to coalesce similar
/// reports. /// reports.
void EmitReport(BugReport *R); void emitReport(BugReport *R);
void EmitBasicReport(const Decl *DeclWithIssue, void EmitBasicReport(const Decl *DeclWithIssue,
StringRef BugName, StringRef BugCategory, StringRef BugName, StringRef BugCategory,

Просмотреть файл

@ -202,9 +202,9 @@ public:
} }
/// \brief Emit the diagnostics report. /// \brief Emit the diagnostics report.
void EmitReport(BugReport *R) { void emitReport(BugReport *R) {
Changed = true; Changed = true;
Eng.getBugReporter().EmitReport(R); Eng.getBugReporter().emitReport(R);
} }
/// \brief Get the declaration of the called function (path-sensitive). /// \brief Get the declaration of the called function (path-sensitive).

Просмотреть файл

@ -78,7 +78,7 @@ void ArrayBoundChecker::checkLocation(SVal l, bool isLoad, const Stmt* LoadS,
new BugReport(*BT, BT->getDescription(), N); new BugReport(*BT, BT->getDescription(), N);
report->addRange(LoadS->getSourceRange()); report->addRange(LoadS->getSourceRange());
C.EmitReport(report); C.emitReport(report);
return; return;
} }

Просмотреть файл

@ -208,7 +208,7 @@ void ArrayBoundCheckerV2::reportOOB(CheckerContext &checkerContext,
break; break;
} }
checkerContext.EmitReport(new BugReport(*BT, os.str(), errorNode)); checkerContext.emitReport(new BugReport(*BT, os.str(), errorNode));
} }
void RegionRawOffsetV2::dump() const { void RegionRawOffsetV2::dump() const {

Просмотреть файл

@ -107,7 +107,7 @@ void AttrNonNullChecker::checkPreCall(const CallEvent &Call,
if (const Expr *ArgE = Call.getArgExpr(idx)) if (const Expr *ArgE = Call.getArgExpr(idx))
bugreporter::trackNullOrUndefValue(errorNode, ArgE, *R); bugreporter::trackNullOrUndefValue(errorNode, ArgE, *R);
// Emit the bug report. // Emit the bug report.
C.EmitReport(R); C.emitReport(R);
} }
// Always return. Either we cached out or we just emitted an error. // Always return. Either we cached out or we just emitted an error.

Просмотреть файл

@ -117,7 +117,7 @@ void NilArgChecker::WarnNilArg(CheckerContext &C,
BugReport *R = new BugReport(*BT, os.str(), N); BugReport *R = new BugReport(*BT, os.str(), N);
R->addRange(msg.getArgSourceRange(Arg)); R->addRange(msg.getArgSourceRange(Arg));
C.EmitReport(R); C.emitReport(R);
} }
} }
@ -358,7 +358,7 @@ void CFNumberCreateChecker::checkPreStmt(const CallExpr *CE,
BugReport *report = new BugReport(*BT, os.str(), N); BugReport *report = new BugReport(*BT, os.str(), N);
report->addRange(CE->getArg(2)->getSourceRange()); report->addRange(CE->getArg(2)->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
} }
@ -433,7 +433,7 @@ void CFRetainReleaseChecker::checkPreStmt(const CallExpr *CE,
BugReport *report = new BugReport(*BT, description, N); BugReport *report = new BugReport(*BT, description, N);
report->addRange(Arg->getSourceRange()); report->addRange(Arg->getSourceRange());
bugreporter::trackNullOrUndefValue(N, Arg, *report); bugreporter::trackNullOrUndefValue(N, Arg, *report);
C.EmitReport(report); C.emitReport(report);
return; return;
} }
@ -491,7 +491,7 @@ void ClassReleaseChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
BugReport *report = new BugReport(*BT, os.str(), N); BugReport *report = new BugReport(*BT, os.str(), N);
report->addRange(msg.getSourceRange()); report->addRange(msg.getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
} }
@ -644,7 +644,7 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
BugReport *R = new BugReport(*BT, os.str(), errorNode.getValue()); BugReport *R = new BugReport(*BT, os.str(), errorNode.getValue());
R->addRange(msg.getArgSourceRange(I)); R->addRange(msg.getArgSourceRange(I));
C.EmitReport(R); C.emitReport(R);
} }
} }

Просмотреть файл

@ -35,7 +35,7 @@ void BoolAssignmentChecker::emitReport(ProgramStateRef state,
if (ExplodedNode *N = C.addTransition(state)) { if (ExplodedNode *N = C.addTransition(state)) {
if (!BT) if (!BT)
BT.reset(new BuiltinBug("Assignment of a non-Boolean value")); BT.reset(new BuiltinBug("Assignment of a non-Boolean value"));
C.EmitReport(new BugReport(*BT, BT->getDescription(), N)); C.emitReport(new BugReport(*BT, BT->getDescription(), N));
} }
} }

Просмотреть файл

@ -253,7 +253,7 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C,
report->addRange(S->getSourceRange()); report->addRange(S->getSourceRange());
bugreporter::trackNullOrUndefValue(N, S, *report); bugreporter::trackNullOrUndefValue(N, S, *report);
C.EmitReport(report); C.emitReport(report);
return NULL; return NULL;
} }
@ -327,7 +327,7 @@ ProgramStateRef CStringChecker::CheckLocation(CheckerContext &C,
// reference is outside the range. // reference is outside the range.
report->addRange(S->getSourceRange()); report->addRange(S->getSourceRange());
C.EmitReport(report); C.emitReport(report);
return NULL; return NULL;
} }
@ -544,7 +544,7 @@ void CStringChecker::emitOverlapBug(CheckerContext &C, ProgramStateRef state,
report->addRange(First->getSourceRange()); report->addRange(First->getSourceRange());
report->addRange(Second->getSourceRange()); report->addRange(Second->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
ProgramStateRef CStringChecker::checkAdditionOverflow(CheckerContext &C, ProgramStateRef CStringChecker::checkAdditionOverflow(CheckerContext &C,
@ -607,7 +607,7 @@ ProgramStateRef CStringChecker::checkAdditionOverflow(CheckerContext &C,
// Generate a report for this bug. // Generate a report for this bug.
BugReport *report = new BugReport(*BT_AdditionOverflow, warning, N); BugReport *report = new BugReport(*BT_AdditionOverflow, warning, N);
C.EmitReport(report); C.emitReport(report);
return NULL; return NULL;
} }
@ -714,7 +714,7 @@ SVal CStringChecker::getCStringLength(CheckerContext &C, ProgramStateRef &state,
os.str(), N); os.str(), N);
report->addRange(Ex->getSourceRange()); report->addRange(Ex->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
return UndefinedVal(); return UndefinedVal();
@ -778,7 +778,7 @@ SVal CStringChecker::getCStringLength(CheckerContext &C, ProgramStateRef &state,
os.str(), N); os.str(), N);
report->addRange(Ex->getSourceRange()); report->addRange(Ex->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
return UndefinedVal(); return UndefinedVal();

Просмотреть файл

@ -77,7 +77,7 @@ void CallAndMessageChecker::emitBadCall(BugType *BT, CheckerContext &C,
R->addRange(BadE->getSourceRange()); R->addRange(BadE->getSourceRange());
bugreporter::trackNullOrUndefValue(N, BadE, *R); bugreporter::trackNullOrUndefValue(N, BadE, *R);
} }
C.EmitReport(R); C.emitReport(R);
} }
static StringRef describeUninitializedArgumentInCall(const CallEvent &Call, static StringRef describeUninitializedArgumentInCall(const CallEvent &Call,
@ -123,7 +123,7 @@ bool CallAndMessageChecker::PreVisitProcessArg(CheckerContext &C,
R->addRange(argRange); R->addRange(argRange);
if (argEx) if (argEx)
bugreporter::trackNullOrUndefValue(N, argEx, *R); bugreporter::trackNullOrUndefValue(N, argEx, *R);
C.EmitReport(R); C.emitReport(R);
} }
return true; return true;
} }
@ -207,7 +207,7 @@ bool CallAndMessageChecker::PreVisitProcessArg(CheckerContext &C,
// FIXME: enhance track back for uninitialized value for arbitrary // FIXME: enhance track back for uninitialized value for arbitrary
// memregions // memregions
C.EmitReport(R); C.emitReport(R);
} }
return true; return true;
} }
@ -336,7 +336,7 @@ void CallAndMessageChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
// FIXME: getTrackNullOrUndefValueVisitor can't handle "super" yet. // FIXME: getTrackNullOrUndefValueVisitor can't handle "super" yet.
if (const Expr *ReceiverE = ME->getInstanceReceiver()) if (const Expr *ReceiverE = ME->getInstanceReceiver())
bugreporter::trackNullOrUndefValue(N, ReceiverE, *R); bugreporter::trackNullOrUndefValue(N, ReceiverE, *R);
C.EmitReport(R); C.emitReport(R);
} }
return; return;
} else { } else {
@ -379,7 +379,7 @@ void CallAndMessageChecker::emitNilReceiverBug(CheckerContext &C,
if (const Expr *receiver = ME->getInstanceReceiver()) { if (const Expr *receiver = ME->getInstanceReceiver()) {
bugreporter::trackNullOrUndefValue(N, receiver, *report); bugreporter::trackNullOrUndefValue(N, receiver, *report);
} }
C.EmitReport(report); C.emitReport(report);
} }
static bool supportsNilWithFloatRet(const llvm::Triple &triple) { static bool supportsNilWithFloatRet(const llvm::Triple &triple) {

Просмотреть файл

@ -75,7 +75,7 @@ void CastSizeChecker::checkPreStmt(const CastExpr *CE,CheckerContext &C) const {
BugReport *R = new BugReport(*BT, BT->getDescription(), BugReport *R = new BugReport(*BT, BT->getDescription(),
errorNode); errorNode);
R->addRange(CE->getSourceRange()); R->addRange(CE->getSourceRange());
C.EmitReport(R); C.emitReport(R);
} }
} }
} }

Просмотреть файл

@ -64,7 +64,7 @@ void CastToStructChecker::checkPreStmt(const CastExpr *CE,
"errors or data corruption.")); "errors or data corruption."));
BugReport *R = new BugReport(*BT,BT->getDescription(), N); BugReport *R = new BugReport(*BT,BT->getDescription(), N);
R->addRange(CE->getSourceRange()); R->addRange(CE->getSourceRange());
C.EmitReport(R); C.emitReport(R);
} }
} }
} }

Просмотреть файл

@ -147,7 +147,7 @@ void ChrootChecker::checkPreStmt(const CallExpr *CE, CheckerContext &C) const {
"after chroot")); "after chroot"));
BugReport *R = new BugReport(*BT_BreakJail, BugReport *R = new BugReport(*BT_BreakJail,
BT_BreakJail->getDescription(), N); BT_BreakJail->getDescription(), N);
C.EmitReport(R); C.emitReport(R);
} }
return; return;

Просмотреть файл

@ -162,7 +162,7 @@ void DereferenceChecker::reportBug(ProgramStateRef State, const Stmt *S,
I = Ranges.begin(), E = Ranges.end(); I!=E; ++I) I = Ranges.begin(), E = Ranges.end(); I!=E; ++I)
report->addRange(*I); report->addRange(*I);
C.EmitReport(report); C.emitReport(report);
} }
void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S, void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S,
@ -177,7 +177,7 @@ void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S,
new BugReport(*BT_undef, BT_undef->getDescription(), N); new BugReport(*BT_undef, BT_undef->getDescription(), N);
bugreporter::trackNullOrUndefValue(N, bugreporter::GetDerefExpr(N), bugreporter::trackNullOrUndefValue(N, bugreporter::GetDerefExpr(N),
*report); *report);
C.EmitReport(report); C.emitReport(report);
} }
return; return;
} }

Просмотреть файл

@ -41,7 +41,7 @@ void DivZeroChecker::reportBug(const char *Msg,
BugReport *R = new BugReport(*BT, Msg, N); BugReport *R = new BugReport(*BT, Msg, N);
bugreporter::trackNullOrUndefValue(N, bugreporter::GetDenomExpr(N), *R); bugreporter::trackNullOrUndefValue(N, bugreporter::GetDenomExpr(N), *R);
C.EmitReport(R); C.emitReport(R);
} }
} }

Просмотреть файл

@ -93,7 +93,7 @@ void ExprInspectionChecker::analyzerEval(const CallExpr *CE,
BT.reset(new BugType("Checking analyzer assumptions", "debug")); BT.reset(new BugType("Checking analyzer assumptions", "debug"));
BugReport *R = new BugReport(*BT, getArgumentValueString(CE, C), N); BugReport *R = new BugReport(*BT, getArgumentValueString(CE, C), N);
C.EmitReport(R); C.emitReport(R);
} }
void ExprInspectionChecker::analyzerCheckInlined(const CallExpr *CE, void ExprInspectionChecker::analyzerCheckInlined(const CallExpr *CE,
@ -113,7 +113,7 @@ void ExprInspectionChecker::analyzerCheckInlined(const CallExpr *CE,
BT.reset(new BugType("Checking analyzer assumptions", "debug")); BT.reset(new BugType("Checking analyzer assumptions", "debug"));
BugReport *R = new BugReport(*BT, getArgumentValueString(CE, C), N); BugReport *R = new BugReport(*BT, getArgumentValueString(CE, C), N);
C.EmitReport(R); C.emitReport(R);
} }
void ento::registerExprInspectionChecker(CheckerManager &Mgr) { void ento::registerExprInspectionChecker(CheckerManager &Mgr) {

Просмотреть файл

@ -58,7 +58,7 @@ void FixedAddressChecker::checkPreStmt(const BinaryOperator *B,
"environments or platforms.")); "environments or platforms."));
BugReport *R = new BugReport(*BT, BT->getDescription(), N); BugReport *R = new BugReport(*BT, BT->getDescription(), N);
R->addRange(B->getRHS()->getSourceRange()); R->addRange(B->getRHS()->getSourceRange());
C.EmitReport(R); C.emitReport(R);
} }
} }

Просмотреть файл

@ -653,7 +653,7 @@ bool GenericTaintChecker::generateReportIfTainted(const Expr *E,
initBugType(); initBugType();
BugReport *report = new BugReport(*BT, Msg, N); BugReport *report = new BugReport(*BT, Msg, N);
report->addRange(E->getSourceRange()); report->addRange(E->getSourceRange());
C.EmitReport(report); C.emitReport(report);
return true; return true;
} }
return false; return false;

Просмотреть файл

@ -430,7 +430,7 @@ void IdempotentOperationChecker::checkEndAnalysis(ExplodedGraph &G,
FindLastStoreBRVisitor::registerStatementVarDecls(*report, RHS); FindLastStoreBRVisitor::registerStatementVarDecls(*report, RHS);
} }
BR.EmitReport(report); BR.emitReport(report);
} }
} }

Просмотреть файл

@ -282,7 +282,7 @@ void MacOSKeychainAPIChecker::
Report->addVisitor(new SecKeychainBugVisitor(AP.first)); Report->addVisitor(new SecKeychainBugVisitor(AP.first));
Report->addRange(ArgExpr->getSourceRange()); Report->addRange(ArgExpr->getSourceRange());
markInteresting(Report, AP); markInteresting(Report, AP);
C.EmitReport(Report); C.emitReport(Report);
} }
void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE, void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
@ -323,7 +323,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
Report->addVisitor(new SecKeychainBugVisitor(V)); Report->addVisitor(new SecKeychainBugVisitor(V));
Report->addRange(ArgExpr->getSourceRange()); Report->addRange(ArgExpr->getSourceRange());
Report->markInteresting(AS->Region); Report->markInteresting(AS->Region);
C.EmitReport(Report); C.emitReport(Report);
} }
} }
return; return;
@ -376,7 +376,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
Report->addRange(ArgExpr->getSourceRange()); Report->addRange(ArgExpr->getSourceRange());
if (AS) if (AS)
Report->markInteresting(AS->Region); Report->markInteresting(AS->Region);
C.EmitReport(Report); C.emitReport(Report);
return; return;
} }
@ -440,7 +440,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
Report->addVisitor(new SecKeychainBugVisitor(ArgSM)); Report->addVisitor(new SecKeychainBugVisitor(ArgSM));
Report->addRange(ArgExpr->getSourceRange()); Report->addRange(ArgExpr->getSourceRange());
Report->markInteresting(AS->Region); Report->markInteresting(AS->Region);
C.EmitReport(Report); C.emitReport(Report);
return; return;
} }
@ -604,7 +604,7 @@ void MacOSKeychainAPIChecker::checkDeadSymbols(SymbolReaper &SR,
// Generate the error reports. // Generate the error reports.
for (AllocationPairVec::iterator I = Errors.begin(), E = Errors.end(); for (AllocationPairVec::iterator I = Errors.begin(), E = Errors.end();
I != E; ++I) { I != E; ++I) {
C.EmitReport(generateAllocatedDataNotReleasedReport(*I, N, C)); C.emitReport(generateAllocatedDataNotReleasedReport(*I, N, C));
} }
// Generate the new, cleaned up state. // Generate the new, cleaned up state.
@ -654,7 +654,7 @@ void MacOSKeychainAPIChecker::checkEndPath(CheckerContext &C) const {
// Generate the error reports. // Generate the error reports.
for (AllocationPairVec::iterator I = Errors.begin(), E = Errors.end(); for (AllocationPairVec::iterator I = Errors.begin(), E = Errors.end();
I != E; ++I) { I != E; ++I) {
C.EmitReport(generateAllocatedDataNotReleasedReport(*I, N, C)); C.emitReport(generateAllocatedDataNotReleasedReport(*I, N, C));
} }
C.addTransition(state, N); C.addTransition(state, N);

Просмотреть файл

@ -94,7 +94,7 @@ void MacOSXAPIChecker::CheckDispatchOnce(CheckerContext &C, const CallExpr *CE,
BugReport *report = new BugReport(*BT_dispatchOnce, os.str(), N); BugReport *report = new BugReport(*BT_dispatchOnce, os.str(), N);
report->addRange(CE->getArg(0)->getSourceRange()); report->addRange(CE->getArg(0)->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

Просмотреть файл

@ -714,7 +714,7 @@ ProgramStateRef MallocChecker::FreeMemAux(CheckerContext &C,
R->addRange(ArgExpr->getSourceRange()); R->addRange(ArgExpr->getSourceRange());
R->markInteresting(Sym); R->markInteresting(Sym);
R->addVisitor(new MallocBugVisitor(Sym)); R->addVisitor(new MallocBugVisitor(Sym));
C.EmitReport(R); C.emitReport(R);
} }
return 0; return 0;
} }
@ -849,7 +849,7 @@ void MallocChecker::ReportBadFree(CheckerContext &C, SVal ArgVal,
BugReport *R = new BugReport(*BT_BadFree, os.str(), N); BugReport *R = new BugReport(*BT_BadFree, os.str(), N);
R->markInteresting(MR); R->markInteresting(MR);
R->addRange(range); R->addRange(range);
C.EmitReport(R); C.emitReport(R);
} }
} }
@ -1048,7 +1048,7 @@ void MallocChecker::reportLeak(SymbolRef Sym, ExplodedNode *N,
BugReport *R = new BugReport(*BT_Leak, os.str(), N, LocUsedForUniqueing); BugReport *R = new BugReport(*BT_Leak, os.str(), N, LocUsedForUniqueing);
R->markInteresting(Sym); R->markInteresting(Sym);
R->addVisitor(new MallocBugVisitor(Sym, true)); R->addVisitor(new MallocBugVisitor(Sym, true));
C.EmitReport(R); C.emitReport(R);
} }
void MallocChecker::checkDeadSymbols(SymbolReaper &SymReaper, void MallocChecker::checkDeadSymbols(SymbolReaper &SymReaper,
@ -1224,7 +1224,7 @@ bool MallocChecker::checkUseAfterFree(SymbolRef Sym, CheckerContext &C,
R->addRange(S->getSourceRange()); R->addRange(S->getSourceRange());
R->markInteresting(Sym); R->markInteresting(Sym);
R->addVisitor(new MallocBugVisitor(Sym)); R->addVisitor(new MallocBugVisitor(Sym));
C.EmitReport(R); C.emitReport(R);
return true; return true;
} }
} }

Просмотреть файл

@ -71,7 +71,7 @@ void NSAutoreleasePoolChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
BugReport *Report = new BugReport(*BT, "Use -drain instead of -release when " BugReport *Report = new BugReport(*BT, "Use -drain instead of -release when "
"using NSAutoreleasePool and garbage collection", N); "using NSAutoreleasePool and garbage collection", N);
Report->addRange(msg.getSourceRange()); Report->addRange(msg.getSourceRange());
C.EmitReport(Report); C.emitReport(Report);
} }
void ento::registerNSAutoreleasePoolChecker(CheckerManager &mgr) { void ento::registerNSAutoreleasePoolChecker(CheckerManager &mgr) {

Просмотреть файл

@ -285,7 +285,7 @@ void NSOrCFErrorDerefChecker::checkEvent(ImplicitNullDerefEvent event) const {
bug = new CFErrorDerefBug(); bug = new CFErrorDerefBug();
BugReport *report = new BugReport(*bug, os.str(), BugReport *report = new BugReport(*bug, os.str(),
event.SinkNode); event.SinkNode);
BR.EmitReport(report); BR.emitReport(report);
} }
static bool IsNSError(QualType T, IdentifierInfo *II) { static bool IsNSError(QualType T, IdentifierInfo *II) {

Просмотреть файл

@ -50,7 +50,7 @@ void ObjCAtSyncChecker::checkPreStmt(const ObjCAtSynchronizedStmt *S,
BugReport *report = BugReport *report =
new BugReport(*BT_undef, BT_undef->getDescription(), N); new BugReport(*BT_undef, BT_undef->getDescription(), N);
bugreporter::trackNullOrUndefValue(N, Ex, *report); bugreporter::trackNullOrUndefValue(N, Ex, *report);
C.EmitReport(report); C.emitReport(report);
} }
return; return;
} }
@ -74,7 +74,7 @@ void ObjCAtSyncChecker::checkPreStmt(const ObjCAtSynchronizedStmt *S,
new BugReport(*BT_null, BT_null->getDescription(), N); new BugReport(*BT_null, BT_null->getDescription(), N);
bugreporter::trackNullOrUndefValue(N, Ex, *report); bugreporter::trackNullOrUndefValue(N, Ex, *report);
C.EmitReport(report); C.emitReport(report);
return; return;
} }
} }

Просмотреть файл

@ -146,7 +146,7 @@ void ObjCContainersChecker::checkPreStmt(const CallExpr *CE,
initBugType(); initBugType();
BugReport *R = new BugReport(*BT, "Index is out of bounds", N); BugReport *R = new BugReport(*BT, "Index is out of bounds", N);
R->addRange(IdxExpr->getSourceRange()); R->addRange(IdxExpr->getSourceRange());
C.EmitReport(R); C.emitReport(R);
return; return;
} }
} }

Просмотреть файл

@ -179,7 +179,7 @@ static void checkForInvalidSelf(const Expr *E, CheckerContext &C,
BugReport *report = BugReport *report =
new BugReport(*new InitSelfBug(), errorStr, N); new BugReport(*new InitSelfBug(), errorStr, N);
C.EmitReport(report); C.emitReport(report);
} }
void ObjCSelfInitChecker::checkPostObjCMessage(const ObjCMethodCall &Msg, void ObjCSelfInitChecker::checkPostObjCMessage(const ObjCMethodCall &Msg,

Просмотреть файл

@ -59,7 +59,7 @@ void PointerArithChecker::checkPreStmt(const BinaryOperator *B,
"dangerous.")); "dangerous."));
BugReport *R = new BugReport(*BT, BT->getDescription(), N); BugReport *R = new BugReport(*BT, BT->getDescription(), N);
R->addRange(B->getSourceRange()); R->addRange(B->getSourceRange());
C.EmitReport(R); C.emitReport(R);
} }
} }
} }

Просмотреть файл

@ -67,7 +67,7 @@ void PointerSubChecker::checkPreStmt(const BinaryOperator *B,
"the same memory chunk may cause incorrect result.")); "the same memory chunk may cause incorrect result."));
BugReport *R = new BugReport(*BT, BT->getDescription(), N); BugReport *R = new BugReport(*BT, BT->getDescription(), N);
R->addRange(B->getSourceRange()); R->addRange(B->getSourceRange());
C.EmitReport(R); C.emitReport(R);
} }
} }

Просмотреть файл

@ -118,7 +118,7 @@ void PthreadLockChecker::AcquireLock(CheckerContext &C, const CallExpr *CE,
"This lock has already " "This lock has already "
"been acquired", N); "been acquired", N);
report->addRange(CE->getArg(0)->getSourceRange()); report->addRange(CE->getArg(0)->getSourceRange());
C.EmitReport(report); C.emitReport(report);
return; return;
} }
@ -183,7 +183,7 @@ void PthreadLockChecker::ReleaseLock(CheckerContext &C, const CallExpr *CE,
"Possible lock order " "Possible lock order "
"reversal", N); "reversal", N);
report->addRange(CE->getArg(0)->getSourceRange()); report->addRange(CE->getArg(0)->getSourceRange());
C.EmitReport(report); C.emitReport(report);
return; return;
} }

Просмотреть файл

@ -3121,7 +3121,7 @@ void RetainCountChecker::processNonLeakError(ProgramStateRef St,
C.isObjCGCEnabled(), SummaryLog, C.isObjCGCEnabled(), SummaryLog,
N, Sym); N, Sym);
report->addRange(ErrorRange); report->addRange(ErrorRange);
C.EmitReport(report); C.emitReport(report);
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -3351,7 +3351,7 @@ void RetainCountChecker::checkReturnWithRetEffect(const ReturnStmt *S,
new CFRefLeakReport(*getLeakAtReturnBug(LOpts, GCEnabled), new CFRefLeakReport(*getLeakAtReturnBug(LOpts, GCEnabled),
LOpts, GCEnabled, SummaryLog, LOpts, GCEnabled, SummaryLog,
N, Sym, C); N, Sym, C);
C.EmitReport(report); C.emitReport(report);
} }
} }
} }
@ -3372,7 +3372,7 @@ void RetainCountChecker::checkReturnWithRetEffect(const ReturnStmt *S,
new CFRefReport(*returnNotOwnedForOwned, new CFRefReport(*returnNotOwnedForOwned,
C.getASTContext().getLangOpts(), C.getASTContext().getLangOpts(),
C.isObjCGCEnabled(), SummaryLog, N, Sym); C.isObjCGCEnabled(), SummaryLog, N, Sym);
C.EmitReport(report); C.emitReport(report);
} }
} }
} }
@ -3552,7 +3552,7 @@ RetainCountChecker::handleAutoreleaseCounts(ProgramStateRef state,
CFRefReport *report = CFRefReport *report =
new CFRefReport(*overAutorelease, LOpts, /* GCEnabled = */ false, new CFRefReport(*overAutorelease, LOpts, /* GCEnabled = */ false,
SummaryLog, N, Sym, os.str()); SummaryLog, N, Sym, os.str());
Ctx.EmitReport(report); Ctx.emitReport(report);
} }
return std::make_pair((ExplodedNode *)0, (ProgramStateRef )0); return std::make_pair((ExplodedNode *)0, (ProgramStateRef )0);
@ -3598,7 +3598,7 @@ RetainCountChecker::processLeaks(ProgramStateRef state,
CFRefLeakReport *report = new CFRefLeakReport(*BT, LOpts, GCEnabled, CFRefLeakReport *report = new CFRefLeakReport(*BT, LOpts, GCEnabled,
SummaryLog, N, *I, Ctx); SummaryLog, N, *I, Ctx);
Ctx.EmitReport(report); Ctx.emitReport(report);
} }
} }

Просмотреть файл

@ -82,7 +82,7 @@ void ReturnPointerRangeChecker::checkPreStmt(const ReturnStmt *RS,
new BugReport(*BT, BT->getDescription(), N); new BugReport(*BT, BT->getDescription(), N);
report->addRange(RetE->getSourceRange()); report->addRange(RetE->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
} }

Просмотреть файл

@ -70,7 +70,7 @@ void ReturnUndefChecker::checkPreStmt(const ReturnStmt *RS,
report->addRange(RetE->getSourceRange()); report->addRange(RetE->getSourceRange());
bugreporter::trackNullOrUndefValue(N, RetE, *report); bugreporter::trackNullOrUndefValue(N, RetE, *report);
C.EmitReport(report); C.emitReport(report);
} }
void ento::registerReturnUndefChecker(CheckerManager &mgr) { void ento::registerReturnUndefChecker(CheckerManager &mgr) {

Просмотреть файл

@ -179,7 +179,7 @@ void SimpleStreamChecker::reportDoubleClose(SymbolRef FileDescSym,
"Closing a previously closed file stream", ErrNode); "Closing a previously closed file stream", ErrNode);
R->addRange(CallExpr->getSourceRange()); R->addRange(CallExpr->getSourceRange());
R->markInteresting(FileDescSym); R->markInteresting(FileDescSym);
C.EmitReport(R); C.emitReport(R);
} }
void SimpleStreamChecker::reportLeaks(SymbolVector LeakedStreams, void SimpleStreamChecker::reportLeaks(SymbolVector LeakedStreams,
@ -192,7 +192,7 @@ void SimpleStreamChecker::reportLeaks(SymbolVector LeakedStreams,
BugReport *R = new BugReport(*LeakBugType, BugReport *R = new BugReport(*LeakBugType,
"Opened file is never closed; potential resource leak", ErrNode); "Opened file is never closed; potential resource leak", ErrNode);
R->markInteresting(*I); R->markInteresting(*I);
C.EmitReport(R); C.emitReport(R);
} }
} }

Просмотреть файл

@ -109,7 +109,7 @@ void StackAddrEscapeChecker::EmitStackError(CheckerContext &C, const MemRegion *
if (range.isValid()) if (range.isValid())
report->addRange(range); report->addRange(range);
C.EmitReport(report); C.emitReport(report);
} }
void StackAddrEscapeChecker::checkPreStmt(const ReturnStmt *RS, void StackAddrEscapeChecker::checkPreStmt(const ReturnStmt *RS,
@ -232,7 +232,7 @@ void StackAddrEscapeChecker::checkEndPath(CheckerContext &Ctx) const {
if (range.isValid()) if (range.isValid())
report->addRange(range); report->addRange(range);
Ctx.EmitReport(report); Ctx.emitReport(report);
} }
} }

Просмотреть файл

@ -287,7 +287,7 @@ void StreamChecker::Fseek(CheckerContext &C, const CallExpr *CE) const {
"SEEK_SET, SEEK_END, or SEEK_CUR.")); "SEEK_SET, SEEK_END, or SEEK_CUR."));
BugReport *R = new BugReport(*BT_illegalwhence, BugReport *R = new BugReport(*BT_illegalwhence,
BT_illegalwhence->getDescription(), N); BT_illegalwhence->getDescription(), N);
C.EmitReport(R); C.emitReport(R);
} }
} }
@ -363,7 +363,7 @@ ProgramStateRef StreamChecker::CheckNullStream(SVal SV, ProgramStateRef state,
BT_nullfp.reset(new BuiltinBug("NULL stream pointer", BT_nullfp.reset(new BuiltinBug("NULL stream pointer",
"Stream pointer might be NULL.")); "Stream pointer might be NULL."));
BugReport *R =new BugReport(*BT_nullfp, BT_nullfp->getDescription(), N); BugReport *R =new BugReport(*BT_nullfp, BT_nullfp->getDescription(), N);
C.EmitReport(R); C.emitReport(R);
} }
return 0; return 0;
} }
@ -395,7 +395,7 @@ ProgramStateRef StreamChecker::CheckDoubleClose(const CallExpr *CE,
" closed. Cause undefined behaviour.")); " closed. Cause undefined behaviour."));
BugReport *R = new BugReport(*BT_doubleclose, BugReport *R = new BugReport(*BT_doubleclose,
BT_doubleclose->getDescription(), N); BT_doubleclose->getDescription(), N);
C.EmitReport(R); C.emitReport(R);
} }
return NULL; return NULL;
} }
@ -424,7 +424,7 @@ void StreamChecker::checkDeadSymbols(SymbolReaper &SymReaper,
"Opened File never closed. Potential Resource leak.")); "Opened File never closed. Potential Resource leak."));
BugReport *R = new BugReport(*BT_ResourceLeak, BugReport *R = new BugReport(*BT_ResourceLeak,
BT_ResourceLeak->getDescription(), N); BT_ResourceLeak->getDescription(), N);
C.EmitReport(R); C.emitReport(R);
} }
} }
} }
@ -445,7 +445,7 @@ void StreamChecker::checkEndPath(CheckerContext &Ctx) const {
"Opened File never closed. Potential Resource leak.")); "Opened File never closed. Potential Resource leak."));
BugReport *R = new BugReport(*BT_ResourceLeak, BugReport *R = new BugReport(*BT_ResourceLeak,
BT_ResourceLeak->getDescription(), N); BT_ResourceLeak->getDescription(), N);
Ctx.EmitReport(R); Ctx.emitReport(R);
} }
} }
} }

Просмотреть файл

@ -52,7 +52,7 @@ void TaintTesterChecker::checkPostStmt(const Expr *E,
initBugType(); initBugType();
BugReport *report = new BugReport(*BT, "tainted",N); BugReport *report = new BugReport(*BT, "tainted",N);
report->addRange(E->getSourceRange()); report->addRange(E->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
} }
} }

Просмотреть файл

@ -102,7 +102,7 @@ void UndefBranchChecker::checkBranchCondition(const Stmt *Condition,
bugreporter::trackNullOrUndefValue(N, Ex, *R); bugreporter::trackNullOrUndefValue(N, Ex, *R);
R->addRange(Ex->getSourceRange()); R->addRange(Ex->getSourceRange());
Ctx.EmitReport(R); Ctx.emitReport(R);
} }
} }
} }

Просмотреть файл

@ -96,7 +96,7 @@ UndefCapturedBlockVarChecker::checkPostStmt(const BlockExpr *BE,
R->addVisitor(new FindLastStoreBRVisitor(VRVal, VR)); R->addVisitor(new FindLastStoreBRVisitor(VRVal, VR));
R->disablePathPruning(); R->disablePathPruning();
// need location of block // need location of block
C.EmitReport(R); C.emitReport(R);
} }
} }
} }

Просмотреть файл

@ -81,7 +81,7 @@ void UndefResultChecker::checkPostStmt(const BinaryOperator *B,
else else
bugreporter::trackNullOrUndefValue(N, B, *report); bugreporter::trackNullOrUndefValue(N, B, *report);
C.EmitReport(report); C.emitReport(report);
} }
} }

Просмотреть файл

@ -43,7 +43,7 @@ UndefinedArraySubscriptChecker::checkPreStmt(const ArraySubscriptExpr *A,
BugReport *R = new BugReport(*BT, BT->getName(), N); BugReport *R = new BugReport(*BT, BT->getName(), N);
R->addRange(A->getIdx()->getSourceRange()); R->addRange(A->getIdx()->getSourceRange());
bugreporter::trackNullOrUndefValue(N, A->getIdx(), *R); bugreporter::trackNullOrUndefValue(N, A->getIdx(), *R);
C.EmitReport(R); C.emitReport(R);
} }
} }
} }

Просмотреть файл

@ -80,7 +80,7 @@ void UndefinedAssignmentChecker::checkBind(SVal location, SVal val,
R->addRange(ex->getSourceRange()); R->addRange(ex->getSourceRange());
bugreporter::trackNullOrUndefValue(N, ex, *R); bugreporter::trackNullOrUndefValue(N, ex, *R);
} }
C.EmitReport(R); C.emitReport(R);
} }
void ento::registerUndefinedAssignmentChecker(CheckerManager &mgr) { void ento::registerUndefinedAssignmentChecker(CheckerManager &mgr) {

Просмотреть файл

@ -139,7 +139,7 @@ void UnixAPIChecker::CheckOpen(CheckerContext &C, const CallExpr *CE) const {
"Call to 'open' requires a third argument when " "Call to 'open' requires a third argument when "
"the 'O_CREAT' flag is set", N); "the 'O_CREAT' flag is set", N);
report->addRange(oflagsEx->getSourceRange()); report->addRange(oflagsEx->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
} }
@ -184,7 +184,7 @@ void UnixAPIChecker::CheckPthreadOnce(CheckerContext &C,
BugReport *report = new BugReport(*BT_pthreadOnce, os.str(), N); BugReport *report = new BugReport(*BT_pthreadOnce, os.str(), N);
report->addRange(CE->getArg(0)->getSourceRange()); report->addRange(CE->getArg(0)->getSourceRange());
C.EmitReport(report); C.emitReport(report);
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -227,7 +227,7 @@ bool UnixAPIChecker::ReportZeroByteAllocation(CheckerContext &C,
report->addRange(arg->getSourceRange()); report->addRange(arg->getSourceRange());
bugreporter::trackNullOrUndefValue(N, arg, *report); bugreporter::trackNullOrUndefValue(N, arg, *report);
C.EmitReport(report); C.emitReport(report);
return true; return true;
} }

Просмотреть файл

@ -70,7 +70,7 @@ void VLASizeChecker::reportBug(VLASize_Kind Kind,
BugReport *report = new BugReport(*BT, os.str(), N); BugReport *report = new BugReport(*BT, os.str(), N);
report->addRange(SizeE->getSourceRange()); report->addRange(SizeE->getSourceRange());
bugreporter::trackNullOrUndefValue(N, SizeE, *report); bugreporter::trackNullOrUndefValue(N, SizeE, *report);
C.EmitReport(report); C.emitReport(report);
return; return;
} }

Просмотреть файл

@ -2106,7 +2106,7 @@ void BugReporter::Register(BugType *BT) {
BugTypes = F.add(BugTypes, BT); BugTypes = F.add(BugTypes, BT);
} }
void BugReporter::EmitReport(BugReport* R) { void BugReporter::emitReport(BugReport* R) {
// Compute the bug report's hash to determine its equivalence class. // Compute the bug report's hash to determine its equivalence class.
llvm::FoldingSetNodeID ID; llvm::FoldingSetNodeID ID;
R->Profile(ID); R->Profile(ID);
@ -2309,7 +2309,7 @@ void BugReporter::EmitBasicReport(const Decl *DeclWithIssue,
BugReport *R = new BugReport(*BT, str, Loc); BugReport *R = new BugReport(*BT, str, Loc);
R->setDeclWithIssue(DeclWithIssue); R->setDeclWithIssue(DeclWithIssue);
for ( ; NumRanges > 0 ; --NumRanges, ++RBeg) R->addRange(*RBeg); for ( ; NumRanges > 0 ; --NumRanges, ++RBeg) R->addRange(*RBeg);
EmitReport(R); emitReport(R);
} }
BugType *BugReporter::getBugTypeForName(StringRef name, BugType *BugReporter::getBugTypeForName(StringRef name,