From 22fe248abdab6ff458d57b7f0afa562d63908d25 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 4 May 2009 04:30:18 +0000 Subject: [PATCH] retain checker: Don't bother using a FoldingSet to unique summaries. We never compare summaries by their pointers, and we create only a handful of them when analyzing a given function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70824 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/CFRefCount.cpp | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 58f581aff8..505ec7d11d 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -530,9 +530,6 @@ class VISIBILITY_HIDDEN RetainSummaryManager { // Typedefs. //==-----------------------------------------------------------------==// - typedef llvm::FoldingSet - SummarySetTy; - typedef llvm::DenseMap FuncSummariesTy; @@ -551,10 +548,7 @@ class VISIBILITY_HIDDEN RetainSummaryManager { /// GCEnabled - Records whether or not the analyzed code runs in GC mode. const bool GCEnabled; - - /// SummarySet - A FoldingSet of uniqued summaries. - SummarySetTy SummarySet; - + /// FuncSummaries - A map from FunctionDecls to summaries. FuncSummariesTy FuncSummaries; @@ -782,25 +776,10 @@ RetainSummary* RetainSummaryManager::getPersistentSummary(ArgEffects AE, RetEffect RetEff, ArgEffect ReceiverEff, ArgEffect DefaultEff, - bool isEndPath) { - - // Generate a profile for the summary. - llvm::FoldingSetNodeID profile; - RetainSummary::Profile(profile, AE, RetEff, DefaultEff, ReceiverEff, - isEndPath); - - // Look up the uniqued summary, or create one if it doesn't exist. - void* InsertPos; - RetainSummary* Summ = SummarySet.FindNodeOrInsertPos(profile, InsertPos); - - if (Summ) - return Summ; - + bool isEndPath) { // Create the summary and return it. - Summ = (RetainSummary*) BPAlloc.Allocate(); + RetainSummary *Summ = (RetainSummary*) BPAlloc.Allocate(); new (Summ) RetainSummary(AE, RetEff, DefaultEff, ReceiverEff, isEndPath); - SummarySet.InsertNode(Summ, InsertPos); - return Summ; } -- 2.40.0