Add #include
[oota-llvm.git] / include / llvm / Analysis / DataStructure / DSGraph.h
1 //===- DSGraph.h - Represent a collection of data structures ----*- C++ -*-===//
2 //
3 // This header defines the primative classes that make up a data structure
4 // graph.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef LLVM_ANALYSIS_DSGRAPH_H
9 #define LLVM_ANALYSIS_DSGRAPH_H
10
11 #include <vector>
12 #include <map>
13 #include <functional>
14 #include <string>
15
16 class Function;
17 class CallInst;
18 class Value;
19 class GlobalValue;
20 class Type;
21
22 class DSNode;                  // Each node in the graph
23 class DSGraph;                 // A graph for a function
24 class DSNodeIterator;          // Data structure graph traversal iterator
25
26
27 //===----------------------------------------------------------------------===//
28 /// DSNodeHandle - Implement a "handle" to a data structure node that takes care
29 /// of all of the add/un'refing of the node to prevent the backpointers in the
30 /// graph from getting out of date.  This class represents a "pointer" in the
31 /// graph, whose destination is an indexed offset into a node.
32 ///
33 class DSNodeHandle {
34   DSNode *N;
35   unsigned Offset;
36 public:
37   // Allow construction, destruction, and assignment...
38   DSNodeHandle(DSNode *n = 0, unsigned offs = 0) : N(0), Offset(offs) {
39     setNode(n);
40   }
41   DSNodeHandle(const DSNodeHandle &H) : N(0), Offset(H.Offset) { setNode(H.N); }
42   ~DSNodeHandle() { setNode((DSNode*)0); }
43   DSNodeHandle &operator=(const DSNodeHandle &H) {
44     setNode(H.N); Offset = H.Offset;
45     return *this;
46   }
47
48   bool operator<(const DSNodeHandle &H) const {  // Allow sorting
49     return N < H.N || (N == H.N && Offset < H.Offset);
50   }
51   bool operator>(const DSNodeHandle &H) const { return H < *this; }
52   bool operator==(const DSNodeHandle &H) const { // Allow comparison
53     return N == H.N && Offset == H.Offset;
54   }
55   bool operator!=(const DSNodeHandle &H) const { return !operator==(H); }
56
57   // Allow explicit conversion to DSNode...
58   DSNode *getNode() const { return N; }
59   unsigned getOffset() const { return Offset; }
60
61   inline void setNode(DSNode *N);  // Defined inline later...
62   void setOffset(unsigned O) { Offset = O; }
63
64   void addEdgeTo(unsigned LinkNo, const DSNodeHandle &N);
65   void addEdgeTo(const DSNodeHandle &N) { addEdgeTo(0, N); }
66
67   /// mergeWith - Merge the logical node pointed to by 'this' with the node
68   /// pointed to by 'N'.
69   ///
70   void mergeWith(const DSNodeHandle &N);
71
72   // hasLink - Return true if there is a link at the specified offset...
73   inline bool hasLink(unsigned Num) const;
74
75   /// getLink - Treat this current node pointer as a pointer to a structure of
76   /// some sort.  This method will return the pointer a mem[this+Num]
77   ///
78   inline const DSNodeHandle *getLink(unsigned Num) const;
79   inline DSNodeHandle *getLink(unsigned Num);
80
81   inline void setLink(unsigned Num, const DSNodeHandle &NH);
82 };
83
84
85 //===----------------------------------------------------------------------===//
86 /// DSNode - Data structure node class
87 ///
88 /// This class represents an untyped memory object of Size bytes.  It keeps
89 /// track of any pointers that have been stored into the object as well as the
90 /// different types represented in this object.
91 ///
92 class DSNode {
93   /// Links - Contains one entry for every _distinct_ pointer field in the
94   /// memory block.  These are demand allocated and indexed by the MergeMap
95   /// vector.
96   ///
97   std::vector<DSNodeHandle> Links;
98
99   /// MergeMap - Maps from every byte in the object to a signed byte number.
100   /// This map is neccesary due to the merging that is possible as part of the
101   /// unification algorithm.  To merge two distinct bytes of the object together
102   /// into a single logical byte, the indexes for the two bytes are set to the
103   /// same value.  This fully general merging is capable of representing all
104   /// manners of array merging if neccesary.
105   ///
106   /// This map is also used to map outgoing pointers to various byte offsets in
107   /// this data structure node.  If this value is >= 0, then it indicates that
108   /// the numbered entry in the Links vector contains the outgoing edge for this
109   /// byte offset.  In this way, the Links vector can be demand allocated and
110   /// byte elements of the node may be merged without needing a Link allocated
111   /// for it.
112   ///
113   /// Initially, each each element of the MergeMap is assigned a unique negative
114   /// number, which are then merged as the unification occurs.
115   ///
116   std::vector<signed char> MergeMap;
117
118   /// Referrers - Keep track of all of the node handles that point to this
119   /// DSNode.  These pointers may need to be updated to point to a different
120   /// node if this node gets merged with it.
121   ///
122   std::vector<DSNodeHandle*> Referrers;
123
124   /// TypeRec - This structure is used to represent a single type that is held
125   /// in a DSNode.
126   struct TypeRec {
127     const Type *Ty;                 // The type itself...
128     unsigned Offset;                // The offset in the node
129     bool isArray;                   // Have we accessed an array of elements?
130
131     TypeRec() : Ty(0), Offset(0), isArray(false) {}
132     TypeRec(const Type *T, unsigned O) : Ty(T), Offset(O), isArray(false) {}
133
134     bool operator<(const TypeRec &TR) const {
135       // Sort first by offset!
136       return Offset < TR.Offset || (Offset == TR.Offset && Ty < TR.Ty);
137     }
138     bool operator==(const TypeRec &TR) const {
139       return Ty == TR.Ty && Offset == TR.Offset;
140     }
141     bool operator!=(const TypeRec &TR) const { return !operator==(TR); }
142   };
143
144   /// TypeEntries - As part of the merging process of this algorithm, nodes of
145   /// different types can be represented by this single DSNode.  This vector is
146   /// kept sorted.
147   ///
148   std::vector<TypeRec> TypeEntries;
149
150   /// Globals - The list of global values that are merged into this node.
151   ///
152   std::vector<GlobalValue*> Globals;
153
154   void operator=(const DSNode &); // DO NOT IMPLEMENT
155 public:
156   enum NodeTy {
157     ShadowNode = 0,        // Nothing is known about this node...
158     ScalarNode = 1 << 0,   // Scalar of the current function contains this value
159     AllocaNode = 1 << 1,   // This node was allocated with alloca
160     NewNode    = 1 << 2,   // This node was allocated with malloc
161     GlobalNode = 1 << 3,   // This node was allocated by a global var decl
162     Incomplete = 1 << 4,   // This node may not be complete
163     Modified   = 1 << 5,   // This node is modified in this context
164     Read       = 1 << 6,   // This node is read in this context
165   };
166   
167   /// NodeType - A union of the above bits.  "Shadow" nodes do not add any flags
168   /// to the nodes in the data structure graph, so it is possible to have nodes
169   /// with a value of 0 for their NodeType.  Scalar and Alloca markers go away
170   /// when function graphs are inlined.
171   ///
172   unsigned char NodeType;
173
174   DSNode(enum NodeTy NT, const Type *T);
175   DSNode(const DSNode &);
176
177   ~DSNode() {
178 #ifndef NDEBUG
179     dropAllReferences();  // Only needed to satisfy assertion checks...
180     assert(Referrers.empty() && "Referrers to dead node exist!");
181 #endif
182   }
183
184   // Iterator for graph interface...
185   typedef DSNodeIterator iterator;
186   typedef DSNodeIterator const_iterator;
187   inline iterator begin() const;   // Defined in DSGraphTraits.h
188   inline iterator end() const;
189
190   //===--------------------------------------------------
191   // Accessors
192
193   /// getSize - Return the maximum number of bytes occupied by this object...
194   ///
195   unsigned getSize() const { return MergeMap.size(); }
196
197   // getTypeEntries - Return the possible types and their offsets in this object
198   const std::vector<TypeRec> &getTypeEntries() const { return TypeEntries; }
199
200   /// getReferrers - Return a list of the pointers to this node...
201   ///
202   const std::vector<DSNodeHandle*> &getReferrers() const { return Referrers; }
203
204   /// isModified - Return true if this node may be modified in this context
205   ///
206   bool isModified() const { return (NodeType & Modified) != 0; }
207
208   /// isRead - Return true if this node may be read in this context
209   ///
210   bool isRead() const { return (NodeType & Read) != 0; }
211
212
213   /// hasLink - Return true if this memory object has a link at the specified
214   /// location.
215   ///
216   bool hasLink(unsigned i) const {
217     assert(i < getSize() && "Field Link index is out of range!");
218     return MergeMap[i] >= 0;
219   }
220
221   DSNodeHandle *getLink(unsigned i) {
222     if (hasLink(i))
223       return &Links[MergeMap[i]];
224     return 0;
225   }
226   const DSNodeHandle *getLink(unsigned i) const {
227     if (hasLink(i))
228       return &Links[MergeMap[i]];
229     return 0;
230   }
231
232   int getMergeMapLabel(unsigned i) const {
233     assert(i < MergeMap.size() && "MergeMap index out of range!");
234     return MergeMap[i];
235   }
236
237   /// setLink - Set the link at the specified offset to the specified
238   /// NodeHandle, replacing what was there.  It is uncommon to use this method,
239   /// instead one of the higher level methods should be used, below.
240   ///
241   void setLink(unsigned i, const DSNodeHandle &NH);
242
243   /// addEdgeTo - Add an edge from the current node to the specified node.  This
244   /// can cause merging of nodes in the graph.
245   ///
246   void addEdgeTo(unsigned Offset, const DSNodeHandle &NH);
247
248   /// mergeWith - Merge this node and the specified node, moving all links to
249   /// and from the argument node into the current node, deleting the node
250   /// argument.  Offset indicates what offset the specified node is to be merged
251   /// into the current node.
252   ///
253   /// The specified node may be a null pointer (in which case, nothing happens).
254   ///
255   void mergeWith(const DSNodeHandle &NH, unsigned Offset);
256
257   /// mergeIndexes - If we discover that two indexes are equivalent and must be
258   /// merged, this function is used to do the dirty work.
259   ///
260   void mergeIndexes(unsigned idx1, unsigned idx2) {
261     assert(idx1 < getSize() && idx2 < getSize() && "Indexes out of range!");
262     signed char MV1 = MergeMap[idx1];
263     signed char MV2 = MergeMap[idx2];
264     if (MV1 != MV2)
265       mergeMappedValues(MV1, MV2);
266   }
267
268
269   /// addGlobal - Add an entry for a global value to the Globals list.  This
270   /// also marks the node with the 'G' flag if it does not already have it.
271   ///
272   void addGlobal(GlobalValue *GV);
273   const std::vector<GlobalValue*> &getGlobals() const { return Globals; }
274   std::vector<GlobalValue*> &getGlobals() { return Globals; }
275
276   void print(std::ostream &O, const DSGraph *G) const;
277   void dump() const;
278
279   void dropAllReferences() {
280     Links.clear();
281   }
282
283   /// remapLinks - Change all of the Links in the current node according to the
284   /// specified mapping.
285   void remapLinks(std::map<const DSNode*, DSNode*> &OldNodeMap);
286
287 private:
288   friend class DSNodeHandle;
289   // addReferrer - Keep the referrer set up to date...
290   void addReferrer(DSNodeHandle *H) { Referrers.push_back(H); }
291   void removeReferrer(DSNodeHandle *H);
292
293   /// rewriteMergeMap - Loop over the mergemap, replacing any references to the
294   /// index From to be references to the index To.
295   ///
296   void rewriteMergeMap(signed char From, signed char To) {
297     assert(From != To && "Cannot change something into itself!");
298     for (unsigned i = 0, e = MergeMap.size(); i != e; ++i)
299       if (MergeMap[i] == From)
300         MergeMap[i] = To;
301   }
302
303   /// mergeMappedValues - This is the higher level form of rewriteMergeMap.  It
304   /// is fully capable of merging links together if neccesary as well as simply
305   /// rewriting the map entries.
306   ///
307   void mergeMappedValues(signed char V1, signed char V2);
308 };
309
310
311 //===----------------------------------------------------------------------===//
312 // Define inline DSNodeHandle functions that depend on the definition of DSNode
313 //
314
315 inline void DSNodeHandle::setNode(DSNode *n) {
316   if (N) N->removeReferrer(this);
317   N = n;
318   if (N) N->addReferrer(this);
319 }
320
321 inline bool DSNodeHandle::hasLink(unsigned Num) const {
322   assert(N && "DSNodeHandle does not point to a node yet!");
323   return N->hasLink(Num+Offset);
324 }
325
326
327 /// getLink - Treat this current node pointer as a pointer to a structure of
328 /// some sort.  This method will return the pointer a mem[this+Num]
329 ///
330 inline const DSNodeHandle *DSNodeHandle::getLink(unsigned Num) const {
331   assert(N && "DSNodeHandle does not point to a node yet!");
332   return N->getLink(Num+Offset);
333 }
334 inline DSNodeHandle *DSNodeHandle::getLink(unsigned Num) {
335   assert(N && "DSNodeHandle does not point to a node yet!");
336   return N->getLink(Num+Offset);
337 }
338
339 inline void DSNodeHandle::setLink(unsigned Num, const DSNodeHandle &NH) {
340   assert(N && "DSNodeHandle does not point to a node yet!");
341   N->setLink(Num+Offset, NH);
342 }
343
344 ///  addEdgeTo - Add an edge from the current node to the specified node.  This
345 /// can cause merging of nodes in the graph.
346 ///
347 inline void DSNodeHandle::addEdgeTo(unsigned LinkNo, const DSNodeHandle &Node) {
348   assert(N && "DSNodeHandle does not point to a node yet!");
349   N->addEdgeTo(LinkNo+Offset, Node);
350 }
351
352 /// mergeWith - Merge the logical node pointed to by 'this' with the node
353 /// pointed to by 'N'.
354 ///
355 inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) {
356   assert(N && "DSNodeHandle does not point to a node yet!");
357   N->mergeWith(Node, Offset);
358 }
359
360
361 //===----------------------------------------------------------------------===//
362 /// DSCallSite - Representation of a call site via its call instruction,
363 /// the DSNode handle for the callee function (or function pointer), and
364 /// the DSNode handles for the function arguments.
365 ///
366 /// One unusual aspect of this callsite record is the ResolvingCaller member.
367 /// If this is non-null, then it indicates the function that allowed a call-site
368 /// to finally be resolved.  Because of indirect calls, this function may not
369 /// actually be the function that contains the Call instruction itself.  This is
370 /// used by the BU and TD passes to communicate.
371 /// 
372 class DSCallSite {
373   CallInst    *Inst;                    // Actual call site
374   DSNodeHandle RetVal;                  // Returned value
375   DSNodeHandle Callee;                  // The function node called
376   std::vector<DSNodeHandle> CallArgs;   // The pointer arguments
377   Function    *ResolvingCaller;         // See comments above
378
379   static void InitNH(DSNodeHandle &NH, const DSNodeHandle &Src,
380                      const std::map<const DSNode*, DSNode*> &NodeMap) {
381     if (DSNode *N = Src.getNode()) {
382       std::map<const DSNode*, DSNode*>::const_iterator I = NodeMap.find(N);
383       assert(I != NodeMap.end() && "Not not in mapping!");
384
385       NH.setOffset(Src.getOffset());
386       NH.setNode(I->second);
387     }
388   }
389
390   static void InitNH(DSNodeHandle &NH, const DSNodeHandle &Src,
391                      const std::map<const DSNode*, DSNodeHandle> &NodeMap) {
392     if (DSNode *N = Src.getNode()) {
393       std::map<const DSNode*, DSNodeHandle>::const_iterator I = NodeMap.find(N);
394       assert(I != NodeMap.end() && "Not not in mapping!");
395
396       NH.setOffset(Src.getOffset()+I->second.getOffset());
397       NH.setNode(I->second.getNode());
398     }
399   }
400
401   DSCallSite();                         // DO NOT IMPLEMENT
402 public:
403   /// Constructor.  Note - This ctor destroys the argument vector passed in.  On
404   /// exit, the argument vector is empty.
405   ///
406   DSCallSite(CallInst &inst, const DSNodeHandle &rv, const DSNodeHandle &callee,
407              std::vector<DSNodeHandle> &Args)
408     : Inst(&inst), RetVal(rv), Callee(callee), ResolvingCaller(0) {
409     Args.swap(CallArgs);
410   }
411
412   DSCallSite(const DSCallSite &DSCS)   // Simple copy ctor
413     : Inst(DSCS.Inst), RetVal(DSCS.RetVal),
414       Callee(DSCS.Callee), CallArgs(DSCS.CallArgs),
415       ResolvingCaller(DSCS.ResolvingCaller) {}
416
417   /// Mapping copy constructor - This constructor takes a preexisting call site
418   /// to copy plus a map that specifies how the links should be transformed.
419   /// This is useful when moving a call site from one graph to another.
420   ///
421   template<typename MapTy>
422   DSCallSite(const DSCallSite &FromCall, const MapTy &NodeMap) {
423     Inst = FromCall.Inst;
424     InitNH(RetVal, FromCall.RetVal, NodeMap);
425     InitNH(Callee, FromCall.Callee, NodeMap);
426
427     CallArgs.resize(FromCall.CallArgs.size());
428     for (unsigned i = 0, e = FromCall.CallArgs.size(); i != e; ++i)
429       InitNH(CallArgs[i], FromCall.CallArgs[i], NodeMap);
430     ResolvingCaller = FromCall.ResolvingCaller;
431   }
432
433   // Accessor functions...
434   Function           &getCaller()     const;
435   CallInst           &getCallInst()   const { return *Inst; }
436         DSNodeHandle &getRetVal()           { return RetVal; }
437         DSNodeHandle &getCallee()           { return Callee; }
438   const DSNodeHandle &getRetVal()     const { return RetVal; }
439   const DSNodeHandle &getCallee()     const { return Callee; }
440   void setCallee(const DSNodeHandle &H) { Callee = H; }
441
442   unsigned            getNumPtrArgs() const { return CallArgs.size(); }
443
444   Function           *getResolvingCaller() const { return ResolvingCaller; }
445   void setResolvingCaller(Function *F) { ResolvingCaller = F; }
446
447   DSNodeHandle &getPtrArg(unsigned i) {
448     assert(i < CallArgs.size() && "Argument to getPtrArgNode is out of range!");
449     return CallArgs[i];
450   }
451   const DSNodeHandle &getPtrArg(unsigned i) const {
452     assert(i < CallArgs.size() && "Argument to getPtrArgNode is out of range!");
453     return CallArgs[i];
454   }
455
456   bool operator<(const DSCallSite &CS) const {
457     if (RetVal < CS.RetVal) return true;
458     if (RetVal > CS.RetVal) return false;
459     if (Callee < CS.Callee) return true;
460     if (Callee > CS.Callee) return false;
461     return CallArgs < CS.CallArgs;
462   }
463
464   bool operator==(const DSCallSite &CS) const {
465     return RetVal == CS.RetVal && Callee == CS.Callee &&
466            CallArgs == CS.CallArgs;
467   }
468 };
469
470
471 //===----------------------------------------------------------------------===//
472 /// DSGraph - The graph that represents a function.
473 ///
474 class DSGraph {
475   Function *Func;
476   std::vector<DSNode*> Nodes;
477   DSNodeHandle RetNode;                          // Node that gets returned...
478   std::map<Value*, DSNodeHandle> ValueMap;
479
480 #if 0
481   // GlobalsGraph -- Reference to the common graph of globally visible objects.
482   // This includes GlobalValues, New nodes, Cast nodes, and Calls.
483   // 
484   GlobalDSGraph* GlobalsGraph;
485 #endif
486
487   // FunctionCalls - This vector maintains a single entry for each call
488   // instruction in the current graph.  Each call entry contains DSNodeHandles
489   // that refer to the arguments that are passed into the function call.  The
490   // first entry in the vector is the scalar that holds the return value for the
491   // call, the second is the function scalar being invoked, and the rest are
492   // pointer arguments to the function.
493   //
494   std::vector<DSCallSite> FunctionCalls;
495
496   void operator=(const DSGraph &); // DO NOT IMPLEMENT
497 public:
498   DSGraph() : Func(0) {}           // Create a new, empty, DSGraph.
499   DSGraph(Function &F);            // Compute the local DSGraph
500
501   // Copy ctor - If you want to capture the node mapping between the source and
502   // destination graph, you may optionally do this by specifying a map to record
503   // this into.
504   DSGraph(const DSGraph &DSG);
505   DSGraph(const DSGraph &DSG, std::map<const DSNode*, DSNode*> &BUNodeMap);
506   ~DSGraph();
507
508   bool hasFunction() const { return Func != 0; }
509   Function &getFunction() const { return *Func; }
510
511   /// getNodes - Get a vector of all the nodes in the graph
512   /// 
513   const std::vector<DSNode*> &getNodes() const { return Nodes; }
514         std::vector<DSNode*> &getNodes()       { return Nodes; }
515
516   /// addNode - Add a new node to the graph.
517   ///
518   void addNode(DSNode *N) { Nodes.push_back(N); }
519
520   /// getValueMap - Get a map that describes what the nodes the scalars in this
521   /// function point to...
522   ///
523   std::map<Value*, DSNodeHandle> &getValueMap() { return ValueMap; }
524   const std::map<Value*, DSNodeHandle> &getValueMap() const { return ValueMap;}
525
526   std::vector<DSCallSite> &getFunctionCalls() {
527     return FunctionCalls;
528   }
529   const std::vector<DSCallSite> &getFunctionCalls() const {
530     return FunctionCalls;
531   }
532
533   /// getNodeForValue - Given a value that is used or defined in the body of the
534   /// current function, return the DSNode that it points to.
535   ///
536   DSNodeHandle &getNodeForValue(Value *V) { return ValueMap[V]; }
537
538   const DSNodeHandle &getRetNode() const { return RetNode; }
539         DSNodeHandle &getRetNode()       { return RetNode; }
540
541   unsigned getGraphSize() const {
542     return Nodes.size();
543   }
544
545   void print(std::ostream &O) const;
546   void dump() const;
547   void writeGraphToFile(std::ostream &O, const std::string &GraphName) const;
548
549   // maskNodeTypes - Apply a mask to all of the node types in the graph.  This
550   // is useful for clearing out markers like Scalar or Incomplete.
551   //
552   void maskNodeTypes(unsigned char Mask);
553   void maskIncompleteMarkers() { maskNodeTypes(~DSNode::Incomplete); }
554
555   // markIncompleteNodes - Traverse the graph, identifying nodes that may be
556   // modified by other functions that have not been resolved yet.  This marks
557   // nodes that are reachable through three sources of "unknownness":
558   //   Global Variables, Function Calls, and Incoming Arguments
559   //
560   // For any node that may have unknown components (because something outside
561   // the scope of current analysis may have modified it), the 'Incomplete' flag
562   // is added to the NodeType.
563   //
564   void markIncompleteNodes(bool markFormalArgs = true);
565
566   // removeTriviallyDeadNodes - After the graph has been constructed, this
567   // method removes all unreachable nodes that are created because they got
568   // merged with other nodes in the graph.
569   //
570   void removeTriviallyDeadNodes(bool KeepAllGlobals = false);
571
572   // removeDeadNodes - Use a more powerful reachability analysis to eliminate
573   // subgraphs that are unreachable.  This often occurs because the data
574   // structure doesn't "escape" into it's caller, and thus should be eliminated
575   // from the caller's graph entirely.  This is only appropriate to use when
576   // inlining graphs.
577   //
578   void removeDeadNodes(bool KeepAllGlobals = false, bool KeepCalls = true);
579
580   // cloneInto - Clone the specified DSGraph into the current graph, returning
581   // the Return node of the graph.  The translated ValueMap for the old function
582   // is filled into the OldValMap member.
583   // If StripScalars (StripAllocas) is set to true, Scalar (Alloca) markers
584   // are removed from the graph as the graph is being cloned.
585   //
586   DSNodeHandle cloneInto(const DSGraph &G,
587                          std::map<Value*, DSNodeHandle> &OldValMap,
588                          std::map<const DSNode*, DSNode*> &OldNodeMap,
589                          bool StripScalars = false, bool StripAllocas = false);
590
591 #if 0
592   // cloneGlobalInto - Clone the given global node (or the node for the given
593   // GlobalValue) from the GlobalsGraph and all its target links (recursively).
594   // 
595   DSNode* cloneGlobalInto(const DSNode* GNode);
596   DSNode* cloneGlobalInto(GlobalValue* GV) {
597     assert(!GV || (((DSGraph*) GlobalsGraph)->ValueMap[GV] != 0));
598     return GV? cloneGlobalInto(((DSGraph*) GlobalsGraph)->ValueMap[GV]) : 0;
599   }
600 #endif
601
602 private:
603   bool isNodeDead(DSNode *N);
604 };
605
606 #endif