[cfe-commits] r52565 - /cfe/trunk/lib/Analysis/DeadStores.cpp
Ted Kremenek
kremenek at apple.com
Fri Jun 20 16:13:39 PDT 2008
Author: kremenek
Date: Fri Jun 20 18:13:39 2008
New Revision: 52565
URL: http://llvm.org/viewvc/llvm-project?rev=52565&view=rev
Log:
When using the dead-stores checker with the BugReporter class, properly capture the diagnostic associated with a specific warning and emit it.
Modified:
cfe/trunk/lib/Analysis/DeadStores.cpp
Modified: cfe/trunk/lib/Analysis/DeadStores.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/DeadStores.cpp?rev=52565&r1=52564&r2=52565&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/DeadStores.cpp (original)
+++ cfe/trunk/lib/Analysis/DeadStores.cpp Fri Jun 20 18:13:39 2008
@@ -164,13 +164,18 @@
class VISIBILITY_HIDDEN DiagBugReport : public RangedBugReport {
std::list<std::string> Strs;
FullSourceLoc L;
+ const char* description;
public:
- DiagBugReport(BugType& D, FullSourceLoc l) :
- RangedBugReport(D, NULL), L(l) {}
+ DiagBugReport(const char* desc, BugType& D, FullSourceLoc l) :
+ RangedBugReport(D, NULL), L(l), description(desc) {}
virtual ~DiagBugReport() {}
virtual FullSourceLoc getLocation(SourceManager&) { return L; }
+ virtual const char* getDescription() const {
+ return description;
+ }
+
void addString(const std::string& s) { Strs.push_back(s); }
typedef std::list<std::string>::const_iterator str_iterator;
@@ -198,7 +203,7 @@
// FIXME: Use a map from diag::kind to BugType, instead of having just
// one BugType.
- Reports.push_back(DiagBugReport(D, Pos));
+ Reports.push_back(DiagBugReport(Diags.getDescription(ID), D, Pos));
DiagBugReport& R = Reports.back();
for ( ; NumRanges ; --NumRanges, ++Ranges)
More information about the cfe-commits
mailing list