blob: 732ab6a99509139db3d85cb87500bf8c98462fe7 [file] [log] [blame]
Chris Lattnerbb2a28f2002-03-26 22:39:06 +00001//===- NodeImpl.cpp - Implement the data structure analysis nodes ---------===//
2//
3// Implement the LLVM data structure analysis library.
4//
5//===----------------------------------------------------------------------===//
6
Chris Lattnerb28bf052002-03-31 07:16:08 +00007#include "llvm/Analysis/DataStructureGraph.h"
Chris Lattnere6d4ec32002-04-08 21:58:53 +00008#include "llvm/Assembly/Writer.h"
Chris Lattnerbb2a28f2002-03-26 22:39:06 +00009#include "llvm/DerivedTypes.h"
10#include "llvm/Function.h"
11#include "llvm/BasicBlock.h"
12#include "llvm/iMemory.h"
13#include "llvm/iOther.h"
Chris Lattnerbb2a28f2002-03-26 22:39:06 +000014#include "Support/STLExtras.h"
15#include <algorithm>
16#include <sstream>
17
Chris Lattnerb28bf052002-03-31 07:16:08 +000018bool AllocDSNode::isEquivalentTo(DSNode *Node) const {
19 if (AllocDSNode *N = dyn_cast<AllocDSNode>(Node))
20 return getType() == Node->getType();
Chris Lattnerb28bf052002-03-31 07:16:08 +000021 return false;
22}
23
24bool GlobalDSNode::isEquivalentTo(DSNode *Node) const {
Chris Lattner212be2e2002-04-16 03:44:03 +000025 if (GlobalDSNode *G = dyn_cast<GlobalDSNode>(Node)) {
26 if (G->Val != Val) return false;
27
28 // Check that the outgoing links are identical...
29 assert(getNumLinks() == G->getNumLinks() && "Not identical shape?");
30 for (unsigned i = 0, e = getNumLinks(); i != e; ++i)
31 if (getLink(i) != G->getLink(i)) // Check links
32 return false;
33 return true;
34 }
Chris Lattnerb28bf052002-03-31 07:16:08 +000035 return false;
36}
37
Chris Lattner212be2e2002-04-16 03:44:03 +000038// Call node equivalency - Two call nodes are identical if all of the outgoing
39// links are the same, AND if all of the incoming links are identical.
40//
Chris Lattnerb28bf052002-03-31 07:16:08 +000041bool CallDSNode::isEquivalentTo(DSNode *Node) const {
Chris Lattner212be2e2002-04-16 03:44:03 +000042 if (CallDSNode *C = dyn_cast<CallDSNode>(Node)) {
Chris Lattner7650b942002-04-16 20:39:59 +000043 if (getReferrers().size() != C->getReferrers().size() ||
44 C->getType() != getType())
Chris Lattner212be2e2002-04-16 03:44:03 +000045 return false; // Quick check...
Chris Lattnerb28bf052002-03-31 07:16:08 +000046
Chris Lattner212be2e2002-04-16 03:44:03 +000047 // Check that the outgoing links are identical...
48 assert(getNumLinks() == C->getNumLinks() && "Not identical shape?");
49 for (unsigned i = 0, e = getNumLinks(); i != e; ++i)
50 if (getLink(i) != C->getLink(i)) // Check links
51 return false;
52
53
54 std::vector<PointerValSet*> Refs1 = C->getReferrers();
55 std::vector<PointerValSet*> Refs2 = getReferrers();
56
57 sort(Refs1.begin(), Refs1.end());
58 sort(Refs2.begin(), Refs2.end());
59 if (Refs1 != Refs2) return false; // Incoming edges different?
60
61 // Check that all outgoing links are the same...
62 return C->ArgLinks == ArgLinks; // Check that the arguments are identical
63 }
Chris Lattnerb28bf052002-03-31 07:16:08 +000064 return false;
65}
66
67// NodesAreEquivalent - Check to see if the nodes are equivalent in all ways
68// except node type. Since we know N1 is a shadow node, N2 is allowed to be
69// any type.
70//
71bool ShadowDSNode::isEquivalentTo(DSNode *Node) const {
Chris Lattner0009dac2002-04-04 19:21:51 +000072 return getType() == Node->getType();
Chris Lattnerb28bf052002-03-31 07:16:08 +000073}
74
75
76
77
Chris Lattnerbb2a28f2002-03-26 22:39:06 +000078//===----------------------------------------------------------------------===//
79// DSNode Class Implementation
80//
81
82static void MapPVS(PointerValSet &PVSOut, const PointerValSet &PVSIn,
Chris Lattner1120c8b2002-03-28 17:56:03 +000083 map<const DSNode*, DSNode*> &NodeMap, bool ReinitOk = false){
84 assert((ReinitOk || PVSOut.empty()) && "Value set already initialized!");
Chris Lattnerbb2a28f2002-03-26 22:39:06 +000085
86 for (unsigned i = 0, e = PVSIn.size(); i != e; ++i)
87 PVSOut.add(PointerVal(NodeMap[PVSIn[i].Node], PVSIn[i].Index));
88}
89
90
91
92unsigned countPointerFields(const Type *Ty) {
93 switch (Ty->getPrimitiveID()) {
94 case Type::StructTyID: {
95 const StructType *ST = cast<StructType>(Ty);
96 unsigned Sum = 0;
97 for (unsigned i = 0, e = ST->getNumContainedTypes(); i != e; ++i)
98 Sum += countPointerFields(ST->getContainedType(i));
99
100 return Sum;
101 }
102
103 case Type::ArrayTyID:
104 // All array elements are folded together...
105 return countPointerFields(cast<ArrayType>(Ty)->getElementType());
106
107 case Type::PointerTyID:
108 return 1;
109
110 default: // Some other type, just treat it like a scalar
111 return 0;
112 }
113}
114
115DSNode::DSNode(enum NodeTy NT, const Type *T) : Ty(T), NodeType(NT) {
116 // Create field entries for all of the values in this type...
117 FieldLinks.resize(countPointerFields(getType()));
118}
119
120void DSNode::removeReferrer(PointerValSet *PVS) {
121 vector<PointerValSet*>::iterator I = std::find(Referrers.begin(),
122 Referrers.end(), PVS);
123 assert(I != Referrers.end() && "PVS not pointing to node!");
124 Referrers.erase(I);
125}
126
127
Chris Lattner6088c4f2002-03-27 19:46:05 +0000128// removeAllIncomingEdges - Erase all edges in the graph that point to this node
129void DSNode::removeAllIncomingEdges() {
130 while (!Referrers.empty())
131 Referrers.back()->removePointerTo(this);
132}
133
134
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000135static void replaceIn(std::string &S, char From, const std::string &To) {
136 for (unsigned i = 0; i < S.size(); )
137 if (S[i] == From) {
138 S.replace(S.begin()+i, S.begin()+i+1,
139 To.begin(), To.end());
140 i += To.size();
141 } else {
142 ++i;
143 }
144}
145
146static void writeEdges(std::ostream &O, const void *SrcNode,
147 const char *SrcNodePortName, int SrcNodeIdx,
148 const PointerValSet &VS, const string &EdgeAttr = "") {
149 for (unsigned j = 0, je = VS.size(); j != je; ++j) {
150 O << "\t\tNode" << SrcNode << SrcNodePortName;
151 if (SrcNodeIdx != -1) O << SrcNodeIdx;
152
153 O << " -> Node" << VS[j].Node;
154 if (VS[j].Index)
155 O << ":g" << VS[j].Index;
156
157 if (!EdgeAttr.empty())
158 O << "[" << EdgeAttr << "]";
159 O << ";\n";
160 }
161}
162
163static string escapeLabel(const string &In) {
164 string Label(In);
165 replaceIn(Label, '\\', "\\\\\\\\"); // Escape caption...
166 replaceIn(Label, ' ', "\\ ");
167 replaceIn(Label, '{', "\\{");
168 replaceIn(Label, '}', "\\}");
169 return Label;
170}
171
Chris Lattnerb28bf052002-03-31 07:16:08 +0000172void DSNode::dump() const { print(cerr); }
173
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000174void DSNode::print(std::ostream &O) const {
175 string Caption = escapeLabel(getCaption());
176
177 O << "\t\tNode" << (void*)this << " [ label =\"{" << Caption;
178
179 const vector<PointerValSet> *Links = getAuxLinks();
180 if (Links && !Links->empty()) {
181 O << "|{";
182 for (unsigned i = 0; i < Links->size(); ++i) {
183 if (i) O << "|";
184 O << "<f" << i << ">";
185 }
186 O << "}";
187 }
188
189 if (!FieldLinks.empty()) {
190 O << "|{";
191 for (unsigned i = 0; i < FieldLinks.size(); ++i) {
192 if (i) O << "|";
193 O << "<g" << i << ">";
194 }
195 O << "}";
196 }
197 O << "}\"];\n";
198
199 if (Links)
200 for (unsigned i = 0; i < Links->size(); ++i)
201 writeEdges(O, this, ":f", i, (*Links)[i]);
202 for (unsigned i = 0; i < FieldLinks.size(); ++i)
203 writeEdges(O, this, ":g", i, FieldLinks[i]);
204}
205
206void DSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap, const DSNode *Old) {
207 assert(FieldLinks.size() == Old->FieldLinks.size() &&
208 "Cloned nodes do not have the same number of links!");
209 for (unsigned j = 0, je = FieldLinks.size(); j != je; ++j)
210 MapPVS(FieldLinks[j], Old->FieldLinks[j], NodeMap);
211}
212
Chris Lattner1120c8b2002-03-28 17:56:03 +0000213AllocDSNode::AllocDSNode(AllocationInst *V)
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000214 : DSNode(NewNode, V->getType()->getElementType()), Allocation(V) {
215}
216
Chris Lattner1120c8b2002-03-28 17:56:03 +0000217bool AllocDSNode::isAllocaNode() const {
Chris Lattner6088c4f2002-03-27 19:46:05 +0000218 return isa<AllocaInst>(Allocation);
219}
220
221
Chris Lattner1120c8b2002-03-28 17:56:03 +0000222string AllocDSNode::getCaption() const {
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000223 stringstream OS;
Chris Lattner6088c4f2002-03-27 19:46:05 +0000224 OS << (isMallocNode() ? "new " : "alloca ");
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000225
226 WriteTypeSymbolic(OS, getType(),
227 Allocation->getParent()->getParent()->getParent());
228 if (Allocation->isArrayAllocation())
229 OS << "[ ]";
230 return OS.str();
231}
232
233GlobalDSNode::GlobalDSNode(GlobalValue *V)
234 : DSNode(GlobalNode, V->getType()->getElementType()), Val(V) {
235}
236
237string GlobalDSNode::getCaption() const {
238 stringstream OS;
Chris Lattner7650b942002-04-16 20:39:59 +0000239 if (isa<Function>(Val))
240 OS << "fn ";
241 else
242 OS << "global ";
243
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000244 WriteTypeSymbolic(OS, getType(), Val->getParent());
Chris Lattner7650b942002-04-16 20:39:59 +0000245 return OS.str() + " %" + Val->getName();
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000246}
247
248
Chris Lattner7650b942002-04-16 20:39:59 +0000249ShadowDSNode::ShadowDSNode(const Type *Ty, Module *M) : DSNode(ShadowNode, Ty) {
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000250 Mod = M;
251 ShadowParent = 0;
252}
253
254ShadowDSNode::ShadowDSNode(const Type *Ty, Module *M, ShadowDSNode *ShadParent)
255 : DSNode(ShadowNode, Ty) {
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000256 Mod = M;
257 ShadowParent = ShadParent;
258}
259
260std::string ShadowDSNode::getCaption() const {
261 stringstream OS;
Chris Lattner6088c4f2002-03-27 19:46:05 +0000262 OS << "shadow ";
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000263 WriteTypeSymbolic(OS, getType(), Mod);
Chris Lattner6088c4f2002-03-27 19:46:05 +0000264 return OS.str();
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000265}
266
267void ShadowDSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap,
268 const DSNode *O) {
269 const ShadowDSNode *Old = (ShadowDSNode*)O;
270 DSNode::mapNode(NodeMap, Old); // Map base portions first...
271
272 // Map our SynthNodes...
273 assert(SynthNodes.empty() && "Synthnodes already mapped?");
274 SynthNodes.reserve(Old->SynthNodes.size());
275 for (unsigned i = 0, e = Old->SynthNodes.size(); i != e; ++i)
276 SynthNodes.push_back(std::make_pair(Old->SynthNodes[i].first,
277 (ShadowDSNode*)NodeMap[Old->SynthNodes[i].second]));
278}
279
280
281CallDSNode::CallDSNode(CallInst *ci) : DSNode(CallNode, ci->getType()), CI(ci) {
282 unsigned NumPtrs = 0;
Chris Lattner7650b942002-04-16 20:39:59 +0000283 for (unsigned i = 0, e = ci->getNumOperands(); i != e; ++i)
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000284 if (isa<PointerType>(ci->getOperand(i)->getType()))
285 NumPtrs++;
286 ArgLinks.resize(NumPtrs);
287}
288
289string CallDSNode::getCaption() const {
290 stringstream OS;
291 if (const Function *CM = CI->getCalledFunction())
292 OS << "call " << CM->getName();
293 else
294 OS << "call <indirect>";
295 OS << "|Ret: ";
296 WriteTypeSymbolic(OS, getType(),
297 CI->getParent()->getParent()->getParent());
298 return OS.str();
299}
300
301void CallDSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap,
302 const DSNode *O) {
Chris Lattner1120c8b2002-03-28 17:56:03 +0000303 const CallDSNode *Old = cast<CallDSNode>(O);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000304 DSNode::mapNode(NodeMap, Old); // Map base portions first...
305
306 assert(ArgLinks.size() == Old->ArgLinks.size() && "# Arguments changed!?");
307 for (unsigned i = 0, e = Old->ArgLinks.size(); i != e; ++i)
308 MapPVS(ArgLinks[i], Old->ArgLinks[i], NodeMap);
309}
310
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000311void FunctionDSGraph::printFunction(std::ostream &O,
312 const char *Label) const {
313 O << "\tsubgraph cluster_" << Label << "_Function" << (void*)this << " {\n";
314 O << "\t\tlabel=\"" << Label << " Function\\ " << Func->getName() << "\";\n";
Chris Lattner1120c8b2002-03-28 17:56:03 +0000315 for (unsigned i = 0, e = AllocNodes.size(); i != e; ++i)
316 AllocNodes[i]->print(O);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000317 for (unsigned i = 0, e = ShadowNodes.size(); i != e; ++i)
318 ShadowNodes[i]->print(O);
Chris Lattner1120c8b2002-03-28 17:56:03 +0000319 for (unsigned i = 0, e = GlobalNodes.size(); i != e; ++i)
320 GlobalNodes[i]->print(O);
321 for (unsigned i = 0, e = CallNodes.size(); i != e; ++i)
322 CallNodes[i]->print(O);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000323
324 if (RetNode.size()) {
325 O << "\t\tNode" << (void*)this << Label
326 << " [shape=\"ellipse\", label=\"Returns\"];\n";
327 writeEdges(O, this, Label, -1, RetNode);
328 }
329
330 O << "\n";
331 for (std::map<Value*, PointerValSet>::const_iterator I = ValueMap.begin(),
332 E = ValueMap.end(); I != E; ++I) {
Chris Lattner7650b942002-04-16 20:39:59 +0000333 if (I->second.size()) { // Only output nodes with edges...
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000334 stringstream OS;
335 WriteTypeSymbolic(OS, I->first->getType(), Func->getParent());
336
337 // Create node for I->first
338 O << "\t\tNode" << (void*)I->first << Label << " [shape=\"box\", label=\""
339 << escapeLabel(OS.str()) << "\\n%" << escapeLabel(I->first->getName())
340 << "\",fontsize=\"12.0\",color=\"gray70\"];\n";
341
342 // add edges from I->first to all pointers in I->second
343 writeEdges(O, I->first, Label, -1, I->second,
344 "weight=\"0.9\",color=\"gray70\"");
345 }
346 }
347
348 O << "\t}\n";
349}
350
351// Copy constructor - Since we copy the nodes over, we have to be sure to go
352// through and fix pointers to point into the new graph instead of into the old
353// graph...
354//
355FunctionDSGraph::FunctionDSGraph(const FunctionDSGraph &DSG) : Func(DSG.Func) {
Chris Lattner212be2e2002-04-16 03:44:03 +0000356 vector<PointerValSet> Args;
357 RetNode = cloneFunctionIntoSelf(DSG, true, Args);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000358}
359
360
361// cloneFunctionIntoSelf - Clone the specified method graph into the current
362// method graph, returning the Return's set of the graph. If ValueMap is set
363// to true, the ValueMap of the function is cloned into this function as well
Chris Lattner212be2e2002-04-16 03:44:03 +0000364// as the data structure graph itself. Regardless, the arguments value sets
365// of DSG are copied into Args.
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000366//
367PointerValSet FunctionDSGraph::cloneFunctionIntoSelf(const FunctionDSGraph &DSG,
Chris Lattner212be2e2002-04-16 03:44:03 +0000368 bool CloneValueMap,
369 vector<PointerValSet> &Args) {
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000370 map<const DSNode*, DSNode*> NodeMap; // Map from old graph to new graph...
Chris Lattner1120c8b2002-03-28 17:56:03 +0000371 unsigned StartAllocSize = AllocNodes.size();
372 AllocNodes.reserve(StartAllocSize+DSG.AllocNodes.size());
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000373 unsigned StartShadowSize = ShadowNodes.size();
374 ShadowNodes.reserve(StartShadowSize+DSG.ShadowNodes.size());
Chris Lattner1120c8b2002-03-28 17:56:03 +0000375 unsigned StartGlobalSize = GlobalNodes.size();
376 GlobalNodes.reserve(StartGlobalSize+DSG.GlobalNodes.size());
377 unsigned StartCallSize = CallNodes.size();
378 CallNodes.reserve(StartCallSize+DSG.CallNodes.size());
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000379
Chris Lattner1120c8b2002-03-28 17:56:03 +0000380 // Clone all of the alloc nodes similarly...
381 for (unsigned i = 0, e = DSG.AllocNodes.size(); i != e; ++i) {
382 AllocDSNode *New = cast<AllocDSNode>(DSG.AllocNodes[i]->clone());
383 NodeMap[DSG.AllocNodes[i]] = New;
384 AllocNodes.push_back(New);
385 }
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000386
387 // Clone all of the shadow nodes similarly...
Chris Lattnerdd3fc182002-03-27 00:54:31 +0000388 for (unsigned i = 0, e = DSG.ShadowNodes.size(); i != e; ++i) {
389 ShadowDSNode *New = cast<ShadowDSNode>(DSG.ShadowNodes[i]->clone());
390 NodeMap[DSG.ShadowNodes[i]] = New;
391 ShadowNodes.push_back(New);
392 }
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000393
Chris Lattner1120c8b2002-03-28 17:56:03 +0000394 // Clone all of the global nodes...
395 for (unsigned i = 0, e = DSG.GlobalNodes.size(); i != e; ++i) {
396 GlobalDSNode *New = cast<GlobalDSNode>(DSG.GlobalNodes[i]->clone());
397 NodeMap[DSG.GlobalNodes[i]] = New;
398 GlobalNodes.push_back(New);
399 }
400
401 // Clone all of the call nodes...
402 for (unsigned i = 0, e = DSG.CallNodes.size(); i != e; ++i) {
403 CallDSNode *New = cast<CallDSNode>(DSG.CallNodes[i]->clone());
404 NodeMap[DSG.CallNodes[i]] = New;
405 CallNodes.push_back(New);
406 }
407
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000408 // Convert all of the links over in the nodes now that the map has been filled
409 // in all the way...
410 //
Chris Lattner1120c8b2002-03-28 17:56:03 +0000411 for (unsigned i = 0, e = DSG.AllocNodes.size(); i != e; ++i)
412 AllocNodes[i+StartAllocSize]->mapNode(NodeMap, DSG.AllocNodes[i]);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000413 for (unsigned i = 0, e = DSG.ShadowNodes.size(); i != e; ++i)
414 ShadowNodes[i+StartShadowSize]->mapNode(NodeMap, DSG.ShadowNodes[i]);
Chris Lattner1120c8b2002-03-28 17:56:03 +0000415 for (unsigned i = 0, e = DSG.GlobalNodes.size(); i != e; ++i)
416 GlobalNodes[i+StartGlobalSize]->mapNode(NodeMap, DSG.GlobalNodes[i]);
417 for (unsigned i = 0, e = DSG.CallNodes.size(); i != e; ++i)
418 CallNodes[i+StartCallSize]->mapNode(NodeMap, DSG.CallNodes[i]);
419
Chris Lattner212be2e2002-04-16 03:44:03 +0000420 // Convert over the arguments...
421 Function *OF = DSG.getFunction();
422 for (Function::ArgumentListType::iterator I = OF->getArgumentList().begin(),
423 E = OF->getArgumentList().end(); I != E; ++I)
424 if (isa<PointerType>(((Value*)*I)->getType())) {
425 PointerValSet ArgPVS;
426 assert(DSG.getValueMap().find((Value*)*I) != DSG.getValueMap().end());
427 MapPVS(ArgPVS, DSG.getValueMap().find((Value*)*I)->second, NodeMap);
428 assert(!ArgPVS.empty() && "Argument has no links!");
429 Args.push_back(ArgPVS);
430 }
431
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000432
433 if (CloneValueMap) {
434 // Convert value map... the values themselves stay the same, just the nodes
435 // have to change...
436 //
437 for (std::map<Value*,PointerValSet>::const_iterator I =DSG.ValueMap.begin(),
438 E = DSG.ValueMap.end(); I != E; ++I)
Chris Lattner1120c8b2002-03-28 17:56:03 +0000439 MapPVS(ValueMap[I->first], I->second, NodeMap, true);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000440 }
441
442 // Convert over return node...
443 PointerValSet RetVals;
444 MapPVS(RetVals, DSG.RetNode, NodeMap);
445 return RetVals;
446}
447
448
449FunctionDSGraph::~FunctionDSGraph() {
450 RetNode.clear();
451 ValueMap.clear();
Chris Lattner1120c8b2002-03-28 17:56:03 +0000452 for_each(AllocNodes.begin(), AllocNodes.end(),
453 mem_fun(&DSNode::dropAllReferences));
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000454 for_each(ShadowNodes.begin(), ShadowNodes.end(),
455 mem_fun(&DSNode::dropAllReferences));
Chris Lattner1120c8b2002-03-28 17:56:03 +0000456 for_each(GlobalNodes.begin(), GlobalNodes.end(),
457 mem_fun(&DSNode::dropAllReferences));
458 for_each(CallNodes.begin(), CallNodes.end(),
459 mem_fun(&DSNode::dropAllReferences));
Chris Lattner1120c8b2002-03-28 17:56:03 +0000460 for_each(AllocNodes.begin(), AllocNodes.end(), deleter<DSNode>);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000461 for_each(ShadowNodes.begin(), ShadowNodes.end(), deleter<DSNode>);
Chris Lattner1120c8b2002-03-28 17:56:03 +0000462 for_each(GlobalNodes.begin(), GlobalNodes.end(), deleter<DSNode>);
463 for_each(CallNodes.begin(), CallNodes.end(), deleter<DSNode>);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000464}
465