[callgraph] Use one bump ptr alloctor for all memory allocated in the callgraph.

I also did some small llvm style fixes.

Swift SVN r25515
This commit is contained in:
Michael Gottesman
2015-02-24 22:49:47 +00:00
parent 4a34f25c6b
commit 28cde0e785
2 changed files with 20 additions and 21 deletions

View File

@@ -220,16 +220,14 @@ class CallGraph {
llvm::DenseMap<SILFunction *, CallGraphNode *> FunctionToNodeMap;
llvm::SmallVector<CallGraphSCC *, 16> BottomUpSCCOrder;
std::vector<SILFunction *> BottomUpFunctionOrder;
llvm::BumpPtrAllocator NodeAllocator;
llvm::SpecificBumpPtrAllocator<CallGraphEdge> EdgeAllocator;
/// An allocator used by the callgraph.
llvm::BumpPtrAllocator Allocator;
public:
CallGraph(SILModule *M, bool completeModule);
~CallGraph() {
for (auto *SCC : BottomUpSCCOrder)
delete SCC;
}
~CallGraph() {}
llvm::SmallVectorImpl<CallGraphNode *> &getCallGraphRoots() {
return CallGraphRoots;