[Analyzer] Don't inherit from FoldingSet.

That's not really necessary here. NFCI.

llvm-svn: 232921
This commit is contained in:
Benjamin Kramer 2015-03-22 18:16:22 +00:00
parent 0e66c49d62
commit b474c04f49
2 changed files with 9 additions and 5 deletions

View File

@ -70,11 +70,15 @@ public:
void Profile(llvm::FoldingSetNodeID &ID) { ID = NodeID; }
};
struct FilesMade : public llvm::FoldingSet<PDFileEntry> {
class FilesMade {
llvm::BumpPtrAllocator Alloc;
llvm::FoldingSet<PDFileEntry> Set;
public:
~FilesMade();
bool empty() const { return Set.empty(); }
void addDiagnostic(const PathDiagnostic &PD,
StringRef ConsumerName,
StringRef fileName);

View File

@ -456,7 +456,7 @@ void PathDiagnosticConsumer::FlushDiagnostics(
}
PathDiagnosticConsumer::FilesMade::~FilesMade() {
for (PDFileEntry &Entry : *this)
for (PDFileEntry &Entry : Set)
Entry.~PDFileEntry();
}
@ -466,11 +466,11 @@ void PathDiagnosticConsumer::FilesMade::addDiagnostic(const PathDiagnostic &PD,
llvm::FoldingSetNodeID NodeID;
NodeID.Add(PD);
void *InsertPos;
PDFileEntry *Entry = FindNodeOrInsertPos(NodeID, InsertPos);
PDFileEntry *Entry = Set.FindNodeOrInsertPos(NodeID, InsertPos);
if (!Entry) {
Entry = Alloc.Allocate<PDFileEntry>();
Entry = new (Entry) PDFileEntry(NodeID);
InsertNode(Entry, InsertPos);
Set.InsertNode(Entry, InsertPos);
}
// Allocate persistent storage for the file name.
@ -487,7 +487,7 @@ PathDiagnosticConsumer::FilesMade::getFiles(const PathDiagnostic &PD) {
llvm::FoldingSetNodeID NodeID;
NodeID.Add(PD);
void *InsertPos;
PDFileEntry *Entry = FindNodeOrInsertPos(NodeID, InsertPos);
PDFileEntry *Entry = Set.FindNodeOrInsertPos(NodeID, InsertPos);
if (!Entry)
return nullptr;
return &Entry->files;