+// GlobalIsAlivenessRoot - Return true if the specified global node is
+// intrinsically alive in the context of the current graph (ie, it is a root of
+// aliveness). For TD graphs, no globals are. For the BU graphs all are unless
+// they are trivial globals...
+//
+static bool GlobalIsAlivenessRoot(DSNode *N, unsigned Flags) {
+ if (Flags & DSGraph::RemoveUnreachableGlobals)
+ return false; // If we are to remove all globals, go for it.
+
+ // Ok, we are keeping globals... hrm, we can still delete it if it has no
+ // links, and no mod/ref or other info... If it is not modified, it can't
+ // have links...
+ //
+ if ((N->NodeType & ~(DSNode::Composition | DSNode::Array)) == 0)
+ return false;
+ return true;
+}
+