blob: 47a7dc28e65119592fd00f6dfd87a683c44ddc30 [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)) {
43 if (C->CI->getCalledFunction() != CI->getCalledFunction() ||
44 getReferrers().size() != C->getReferrers().size())
45 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 return !isCriticalNode(); // Must not be a critical node...
74}
75
76
77
78
Chris Lattnerbb2a28f2002-03-26 22:39:06 +000079//===----------------------------------------------------------------------===//
80// DSNode Class Implementation
81//
82
83static void MapPVS(PointerValSet &PVSOut, const PointerValSet &PVSIn,
Chris Lattner1120c8b2002-03-28 17:56:03 +000084 map<const DSNode*, DSNode*> &NodeMap, bool ReinitOk = false){
85 assert((ReinitOk || PVSOut.empty()) && "Value set already initialized!");
Chris Lattnerbb2a28f2002-03-26 22:39:06 +000086
87 for (unsigned i = 0, e = PVSIn.size(); i != e; ++i)
88 PVSOut.add(PointerVal(NodeMap[PVSIn[i].Node], PVSIn[i].Index));
89}
90
91
92
93unsigned countPointerFields(const Type *Ty) {
94 switch (Ty->getPrimitiveID()) {
95 case Type::StructTyID: {
96 const StructType *ST = cast<StructType>(Ty);
97 unsigned Sum = 0;
98 for (unsigned i = 0, e = ST->getNumContainedTypes(); i != e; ++i)
99 Sum += countPointerFields(ST->getContainedType(i));
100
101 return Sum;
102 }
103
104 case Type::ArrayTyID:
105 // All array elements are folded together...
106 return countPointerFields(cast<ArrayType>(Ty)->getElementType());
107
108 case Type::PointerTyID:
109 return 1;
110
111 default: // Some other type, just treat it like a scalar
112 return 0;
113 }
114}
115
116DSNode::DSNode(enum NodeTy NT, const Type *T) : Ty(T), NodeType(NT) {
117 // Create field entries for all of the values in this type...
118 FieldLinks.resize(countPointerFields(getType()));
119}
120
121void DSNode::removeReferrer(PointerValSet *PVS) {
122 vector<PointerValSet*>::iterator I = std::find(Referrers.begin(),
123 Referrers.end(), PVS);
124 assert(I != Referrers.end() && "PVS not pointing to node!");
125 Referrers.erase(I);
126}
127
128
Chris Lattner6088c4f2002-03-27 19:46:05 +0000129// removeAllIncomingEdges - Erase all edges in the graph that point to this node
130void DSNode::removeAllIncomingEdges() {
131 while (!Referrers.empty())
132 Referrers.back()->removePointerTo(this);
133}
134
135
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000136static void replaceIn(std::string &S, char From, const std::string &To) {
137 for (unsigned i = 0; i < S.size(); )
138 if (S[i] == From) {
139 S.replace(S.begin()+i, S.begin()+i+1,
140 To.begin(), To.end());
141 i += To.size();
142 } else {
143 ++i;
144 }
145}
146
147static void writeEdges(std::ostream &O, const void *SrcNode,
148 const char *SrcNodePortName, int SrcNodeIdx,
149 const PointerValSet &VS, const string &EdgeAttr = "") {
150 for (unsigned j = 0, je = VS.size(); j != je; ++j) {
151 O << "\t\tNode" << SrcNode << SrcNodePortName;
152 if (SrcNodeIdx != -1) O << SrcNodeIdx;
153
154 O << " -> Node" << VS[j].Node;
155 if (VS[j].Index)
156 O << ":g" << VS[j].Index;
157
158 if (!EdgeAttr.empty())
159 O << "[" << EdgeAttr << "]";
160 O << ";\n";
161 }
162}
163
164static string escapeLabel(const string &In) {
165 string Label(In);
166 replaceIn(Label, '\\', "\\\\\\\\"); // Escape caption...
167 replaceIn(Label, ' ', "\\ ");
168 replaceIn(Label, '{', "\\{");
169 replaceIn(Label, '}', "\\}");
170 return Label;
171}
172
Chris Lattnerb28bf052002-03-31 07:16:08 +0000173void DSNode::dump() const { print(cerr); }
174
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000175void DSNode::print(std::ostream &O) const {
176 string Caption = escapeLabel(getCaption());
177
178 O << "\t\tNode" << (void*)this << " [ label =\"{" << Caption;
179
180 const vector<PointerValSet> *Links = getAuxLinks();
181 if (Links && !Links->empty()) {
182 O << "|{";
183 for (unsigned i = 0; i < Links->size(); ++i) {
184 if (i) O << "|";
185 O << "<f" << i << ">";
186 }
187 O << "}";
188 }
189
190 if (!FieldLinks.empty()) {
191 O << "|{";
192 for (unsigned i = 0; i < FieldLinks.size(); ++i) {
193 if (i) O << "|";
194 O << "<g" << i << ">";
195 }
196 O << "}";
197 }
198 O << "}\"];\n";
199
200 if (Links)
201 for (unsigned i = 0; i < Links->size(); ++i)
202 writeEdges(O, this, ":f", i, (*Links)[i]);
203 for (unsigned i = 0; i < FieldLinks.size(); ++i)
204 writeEdges(O, this, ":g", i, FieldLinks[i]);
205}
206
207void DSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap, const DSNode *Old) {
208 assert(FieldLinks.size() == Old->FieldLinks.size() &&
209 "Cloned nodes do not have the same number of links!");
210 for (unsigned j = 0, je = FieldLinks.size(); j != je; ++j)
211 MapPVS(FieldLinks[j], Old->FieldLinks[j], NodeMap);
212}
213
Chris Lattner1120c8b2002-03-28 17:56:03 +0000214AllocDSNode::AllocDSNode(AllocationInst *V)
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000215 : DSNode(NewNode, V->getType()->getElementType()), Allocation(V) {
216}
217
Chris Lattner1120c8b2002-03-28 17:56:03 +0000218bool AllocDSNode::isAllocaNode() const {
Chris Lattner6088c4f2002-03-27 19:46:05 +0000219 return isa<AllocaInst>(Allocation);
220}
221
222
Chris Lattner1120c8b2002-03-28 17:56:03 +0000223string AllocDSNode::getCaption() const {
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000224 stringstream OS;
Chris Lattner6088c4f2002-03-27 19:46:05 +0000225 OS << (isMallocNode() ? "new " : "alloca ");
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000226
227 WriteTypeSymbolic(OS, getType(),
228 Allocation->getParent()->getParent()->getParent());
229 if (Allocation->isArrayAllocation())
230 OS << "[ ]";
231 return OS.str();
232}
233
234GlobalDSNode::GlobalDSNode(GlobalValue *V)
235 : DSNode(GlobalNode, V->getType()->getElementType()), Val(V) {
236}
237
238string GlobalDSNode::getCaption() const {
239 stringstream OS;
240 WriteTypeSymbolic(OS, getType(), Val->getParent());
Chris Lattner1120c8b2002-03-28 17:56:03 +0000241 return "global " + OS.str() + " %" + Val->getName();
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000242}
243
244
Chris Lattnerdba61f32002-04-01 00:15:30 +0000245ShadowDSNode::ShadowDSNode(const Type *Ty, Module *M, bool C = false)
246 : DSNode(ShadowNode, Ty) {
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000247 Mod = M;
248 ShadowParent = 0;
Chris Lattner6088c4f2002-03-27 19:46:05 +0000249 CriticalNode = C;
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000250}
251
252ShadowDSNode::ShadowDSNode(const Type *Ty, Module *M, ShadowDSNode *ShadParent)
253 : DSNode(ShadowNode, Ty) {
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000254 Mod = M;
255 ShadowParent = ShadParent;
Chris Lattner6088c4f2002-03-27 19:46:05 +0000256 CriticalNode = false;
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000257}
258
259std::string ShadowDSNode::getCaption() const {
260 stringstream OS;
Chris Lattner6088c4f2002-03-27 19:46:05 +0000261 if (CriticalNode) OS << "# ";
262 OS << "shadow ";
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000263 WriteTypeSymbolic(OS, getType(), Mod);
Chris Lattner6088c4f2002-03-27 19:46:05 +0000264 if (CriticalNode) OS << " #";
265 return OS.str();
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000266}
267
268void ShadowDSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap,
269 const DSNode *O) {
270 const ShadowDSNode *Old = (ShadowDSNode*)O;
271 DSNode::mapNode(NodeMap, Old); // Map base portions first...
272
273 // Map our SynthNodes...
274 assert(SynthNodes.empty() && "Synthnodes already mapped?");
275 SynthNodes.reserve(Old->SynthNodes.size());
276 for (unsigned i = 0, e = Old->SynthNodes.size(); i != e; ++i)
277 SynthNodes.push_back(std::make_pair(Old->SynthNodes[i].first,
278 (ShadowDSNode*)NodeMap[Old->SynthNodes[i].second]));
279}
280
281
282CallDSNode::CallDSNode(CallInst *ci) : DSNode(CallNode, ci->getType()), CI(ci) {
283 unsigned NumPtrs = 0;
284 if (!isa<Function>(ci->getOperand(0)))
285 NumPtrs++; // Include the method pointer...
286
287 for (unsigned i = 1, e = ci->getNumOperands(); i != e; ++i)
288 if (isa<PointerType>(ci->getOperand(i)->getType()))
289 NumPtrs++;
290 ArgLinks.resize(NumPtrs);
291}
292
293string CallDSNode::getCaption() const {
294 stringstream OS;
295 if (const Function *CM = CI->getCalledFunction())
296 OS << "call " << CM->getName();
297 else
298 OS << "call <indirect>";
299 OS << "|Ret: ";
300 WriteTypeSymbolic(OS, getType(),
301 CI->getParent()->getParent()->getParent());
302 return OS.str();
303}
304
305void CallDSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap,
306 const DSNode *O) {
Chris Lattner1120c8b2002-03-28 17:56:03 +0000307 const CallDSNode *Old = cast<CallDSNode>(O);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000308 DSNode::mapNode(NodeMap, Old); // Map base portions first...
309
310 assert(ArgLinks.size() == Old->ArgLinks.size() && "# Arguments changed!?");
311 for (unsigned i = 0, e = Old->ArgLinks.size(); i != e; ++i)
312 MapPVS(ArgLinks[i], Old->ArgLinks[i], NodeMap);
313}
314
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000315void FunctionDSGraph::printFunction(std::ostream &O,
316 const char *Label) const {
317 O << "\tsubgraph cluster_" << Label << "_Function" << (void*)this << " {\n";
318 O << "\t\tlabel=\"" << Label << " Function\\ " << Func->getName() << "\";\n";
Chris Lattner1120c8b2002-03-28 17:56:03 +0000319 for (unsigned i = 0, e = AllocNodes.size(); i != e; ++i)
320 AllocNodes[i]->print(O);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000321 for (unsigned i = 0, e = ShadowNodes.size(); i != e; ++i)
322 ShadowNodes[i]->print(O);
Chris Lattner1120c8b2002-03-28 17:56:03 +0000323 for (unsigned i = 0, e = GlobalNodes.size(); i != e; ++i)
324 GlobalNodes[i]->print(O);
325 for (unsigned i = 0, e = CallNodes.size(); i != e; ++i)
326 CallNodes[i]->print(O);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000327
328 if (RetNode.size()) {
329 O << "\t\tNode" << (void*)this << Label
330 << " [shape=\"ellipse\", label=\"Returns\"];\n";
331 writeEdges(O, this, Label, -1, RetNode);
332 }
333
334 O << "\n";
335 for (std::map<Value*, PointerValSet>::const_iterator I = ValueMap.begin(),
336 E = ValueMap.end(); I != E; ++I) {
337 if (I->second.size()) { // Only output nodes with edges...
338 stringstream OS;
339 WriteTypeSymbolic(OS, I->first->getType(), Func->getParent());
340
341 // Create node for I->first
342 O << "\t\tNode" << (void*)I->first << Label << " [shape=\"box\", label=\""
343 << escapeLabel(OS.str()) << "\\n%" << escapeLabel(I->first->getName())
344 << "\",fontsize=\"12.0\",color=\"gray70\"];\n";
345
346 // add edges from I->first to all pointers in I->second
347 writeEdges(O, I->first, Label, -1, I->second,
348 "weight=\"0.9\",color=\"gray70\"");
349 }
350 }
351
352 O << "\t}\n";
353}
354
355// Copy constructor - Since we copy the nodes over, we have to be sure to go
356// through and fix pointers to point into the new graph instead of into the old
357// graph...
358//
359FunctionDSGraph::FunctionDSGraph(const FunctionDSGraph &DSG) : Func(DSG.Func) {
Chris Lattner212be2e2002-04-16 03:44:03 +0000360 vector<PointerValSet> Args;
361 RetNode = cloneFunctionIntoSelf(DSG, true, Args);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000362}
363
364
365// cloneFunctionIntoSelf - Clone the specified method graph into the current
366// method graph, returning the Return's set of the graph. If ValueMap is set
367// to true, the ValueMap of the function is cloned into this function as well
Chris Lattner212be2e2002-04-16 03:44:03 +0000368// as the data structure graph itself. Regardless, the arguments value sets
369// of DSG are copied into Args.
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000370//
371PointerValSet FunctionDSGraph::cloneFunctionIntoSelf(const FunctionDSGraph &DSG,
Chris Lattner212be2e2002-04-16 03:44:03 +0000372 bool CloneValueMap,
373 vector<PointerValSet> &Args) {
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000374 map<const DSNode*, DSNode*> NodeMap; // Map from old graph to new graph...
Chris Lattner1120c8b2002-03-28 17:56:03 +0000375 unsigned StartAllocSize = AllocNodes.size();
376 AllocNodes.reserve(StartAllocSize+DSG.AllocNodes.size());
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000377 unsigned StartShadowSize = ShadowNodes.size();
378 ShadowNodes.reserve(StartShadowSize+DSG.ShadowNodes.size());
Chris Lattner1120c8b2002-03-28 17:56:03 +0000379 unsigned StartGlobalSize = GlobalNodes.size();
380 GlobalNodes.reserve(StartGlobalSize+DSG.GlobalNodes.size());
381 unsigned StartCallSize = CallNodes.size();
382 CallNodes.reserve(StartCallSize+DSG.CallNodes.size());
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000383
Chris Lattner1120c8b2002-03-28 17:56:03 +0000384 // Clone all of the alloc nodes similarly...
385 for (unsigned i = 0, e = DSG.AllocNodes.size(); i != e; ++i) {
386 AllocDSNode *New = cast<AllocDSNode>(DSG.AllocNodes[i]->clone());
387 NodeMap[DSG.AllocNodes[i]] = New;
388 AllocNodes.push_back(New);
389 }
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000390
391 // Clone all of the shadow nodes similarly...
Chris Lattnerdd3fc182002-03-27 00:54:31 +0000392 for (unsigned i = 0, e = DSG.ShadowNodes.size(); i != e; ++i) {
393 ShadowDSNode *New = cast<ShadowDSNode>(DSG.ShadowNodes[i]->clone());
394 NodeMap[DSG.ShadowNodes[i]] = New;
395 ShadowNodes.push_back(New);
396 }
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000397
Chris Lattner1120c8b2002-03-28 17:56:03 +0000398 // Clone all of the global nodes...
399 for (unsigned i = 0, e = DSG.GlobalNodes.size(); i != e; ++i) {
400 GlobalDSNode *New = cast<GlobalDSNode>(DSG.GlobalNodes[i]->clone());
401 NodeMap[DSG.GlobalNodes[i]] = New;
402 GlobalNodes.push_back(New);
403 }
404
405 // Clone all of the call nodes...
406 for (unsigned i = 0, e = DSG.CallNodes.size(); i != e; ++i) {
407 CallDSNode *New = cast<CallDSNode>(DSG.CallNodes[i]->clone());
408 NodeMap[DSG.CallNodes[i]] = New;
409 CallNodes.push_back(New);
410 }
411
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000412 // Convert all of the links over in the nodes now that the map has been filled
413 // in all the way...
414 //
Chris Lattner1120c8b2002-03-28 17:56:03 +0000415 for (unsigned i = 0, e = DSG.AllocNodes.size(); i != e; ++i)
416 AllocNodes[i+StartAllocSize]->mapNode(NodeMap, DSG.AllocNodes[i]);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000417 for (unsigned i = 0, e = DSG.ShadowNodes.size(); i != e; ++i)
418 ShadowNodes[i+StartShadowSize]->mapNode(NodeMap, DSG.ShadowNodes[i]);
Chris Lattner1120c8b2002-03-28 17:56:03 +0000419 for (unsigned i = 0, e = DSG.GlobalNodes.size(); i != e; ++i)
420 GlobalNodes[i+StartGlobalSize]->mapNode(NodeMap, DSG.GlobalNodes[i]);
421 for (unsigned i = 0, e = DSG.CallNodes.size(); i != e; ++i)
422 CallNodes[i+StartCallSize]->mapNode(NodeMap, DSG.CallNodes[i]);
423
Chris Lattner212be2e2002-04-16 03:44:03 +0000424 // Convert over the arguments...
425 Function *OF = DSG.getFunction();
426 for (Function::ArgumentListType::iterator I = OF->getArgumentList().begin(),
427 E = OF->getArgumentList().end(); I != E; ++I)
428 if (isa<PointerType>(((Value*)*I)->getType())) {
429 PointerValSet ArgPVS;
430 assert(DSG.getValueMap().find((Value*)*I) != DSG.getValueMap().end());
431 MapPVS(ArgPVS, DSG.getValueMap().find((Value*)*I)->second, NodeMap);
432 assert(!ArgPVS.empty() && "Argument has no links!");
433 Args.push_back(ArgPVS);
434 }
435
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000436
437 if (CloneValueMap) {
438 // Convert value map... the values themselves stay the same, just the nodes
439 // have to change...
440 //
441 for (std::map<Value*,PointerValSet>::const_iterator I =DSG.ValueMap.begin(),
442 E = DSG.ValueMap.end(); I != E; ++I)
Chris Lattner1120c8b2002-03-28 17:56:03 +0000443 MapPVS(ValueMap[I->first], I->second, NodeMap, true);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000444 }
445
446 // Convert over return node...
447 PointerValSet RetVals;
448 MapPVS(RetVals, DSG.RetNode, NodeMap);
449 return RetVals;
450}
451
452
453FunctionDSGraph::~FunctionDSGraph() {
454 RetNode.clear();
455 ValueMap.clear();
Chris Lattner1120c8b2002-03-28 17:56:03 +0000456 for_each(AllocNodes.begin(), AllocNodes.end(),
457 mem_fun(&DSNode::dropAllReferences));
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000458 for_each(ShadowNodes.begin(), ShadowNodes.end(),
459 mem_fun(&DSNode::dropAllReferences));
Chris Lattner1120c8b2002-03-28 17:56:03 +0000460 for_each(GlobalNodes.begin(), GlobalNodes.end(),
461 mem_fun(&DSNode::dropAllReferences));
462 for_each(CallNodes.begin(), CallNodes.end(),
463 mem_fun(&DSNode::dropAllReferences));
Chris Lattner1120c8b2002-03-28 17:56:03 +0000464 for_each(AllocNodes.begin(), AllocNodes.end(), deleter<DSNode>);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000465 for_each(ShadowNodes.begin(), ShadowNodes.end(), deleter<DSNode>);
Chris Lattner1120c8b2002-03-28 17:56:03 +0000466 for_each(GlobalNodes.begin(), GlobalNodes.end(), deleter<DSNode>);
467 for_each(CallNodes.begin(), CallNodes.end(), deleter<DSNode>);
Chris Lattnerbb2a28f2002-03-26 22:39:06 +0000468}
469