diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-09-18 07:31:15 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-09-18 07:31:15 +0000 |
commit | e3d209ff7789b482f2c468f9e83f012668980004 (patch) | |
tree | a026ff5c54b7637b4e79738c98341431615cc590 /clang/lib/Analysis/BugReporter.cpp | |
parent | 82f7f9c0800b3c89a9e5531b47aaf422bec605d2 (diff) | |
download | bcm5719-llvm-e3d209ff7789b482f2c468f9e83f012668980004.tar.gz bcm5719-llvm-e3d209ff7789b482f2c468f9e83f012668980004.zip |
Revert most of r82198, which was causing a large number of crashes
when running the analyzer on real projects. We'll keep the change to
AnalysisManager.cpp in r82198 so that -fobjc-gc analyzes code
correctly in both GC and non-GC modes, although this may emit two
diagnostics for each bug in some cases (a better solution will come
later).
llvm-svn: 82201
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r-- | clang/lib/Analysis/BugReporter.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp index 064fff47f4a..38e982888ed 100644 --- a/clang/lib/Analysis/BugReporter.cpp +++ b/clang/lib/Analysis/BugReporter.cpp @@ -1732,50 +1732,6 @@ static BugReport *FindReportInEquivalenceClass(BugReportEquivClass& EQ) { return NULL; } - -//===----------------------------------------------------------------------===// -// DiagnosticCache. This is a hack to cache analyzer diagnostics. It -// uses global state, which eventually should go elsewhere. -//===----------------------------------------------------------------------===// -namespace { -class VISIBILITY_HIDDEN DiagCacheItem : public llvm::FoldingSetNode { - llvm::FoldingSetNodeID ID; -public: - DiagCacheItem(BugReport *R, PathDiagnostic *PD) { - ID.AddString(R->getBugType().getName()); - ID.AddString(R->getBugType().getCategory()); - ID.AddString(R->getDescription()); - ID.AddInteger(R->getLocation().getRawEncoding()); - PD->Profile(ID); - } - - void Profile(llvm::FoldingSetNodeID &id) { - id = ID; - } - - llvm::FoldingSetNodeID &getID() { return ID; } -}; -} - -static bool IsCachedDiagnostic(BugReport *R, PathDiagnostic *PD) { - // FIXME: Eventually this diagnostic cache should reside in something - // like AnalysisManager instead of being a static variable. This is - // really unsafe in the long term. - typedef llvm::FoldingSet<DiagCacheItem> DiagnosticCache; - static DiagnosticCache DC; - - void *InsertPos; - DiagCacheItem *Item = new DiagCacheItem(R, PD); - - if (DC.FindNodeOrInsertPos(Item->getID(), InsertPos)) { - delete Item; - return true; - } - - DC.InsertNode(Item, InsertPos); - return false; -} - void BugReporter::FlushReport(BugReportEquivClass& EQ) { BugReport *R = FindReportInEquivalenceClass(EQ); @@ -1796,9 +1752,6 @@ void BugReporter::FlushReport(BugReportEquivClass& EQ) { GeneratePathDiagnostic(*D.get(), EQ); - if (IsCachedDiagnostic(R, D.get())) - return; - // Get the meta data. std::pair<const char**, const char**> Meta = R->getExtraDescriptiveText(); for (const char** s = Meta.first; s != Meta.second; ++s) |