Fix anand's last checkin
authorChris Lattner <sabre@nondot.org>
Sun, 30 Jun 2002 16:01:15 +0000 (16:01 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 30 Jun 2002 16:01:15 +0000 (16:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2804 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/ComputeClosure.cpp
lib/Analysis/DataStructure/DataStructure.cpp
lib/Analysis/DataStructure/EliminateNodes.cpp
lib/Analysis/DataStructure/FunctionRepBuilder.cpp
lib/Analysis/DataStructure/FunctionRepBuilder.h
lib/Analysis/DataStructure/NodeImpl.cpp

index ed2f93cdf1da3d27cef89e01f39013f0000e1142..0f94b9141c8419932b71e6b986e36b9e8c5a86ae 100644 (file)
@@ -12,7 +12,7 @@
 #include "llvm/iOther.h"
 #include "Support/STLExtras.h"
 #include <algorithm>
-#include <iostream>
+using std::cerr;
 
 // Make all of the pointers that point to Val also point to N.
 //
@@ -111,8 +111,8 @@ void FunctionDSGraph::computeClosure(const DataStructure &DS) {
     Function *F = cast<Function>(FGDN->getGlobal());
 
     if ((int)NumInlines++ == InlineLimit) {      // CUTE hack huh?
-      std::cerr << "Infinite (?) recursion halted\n";
-      std::cerr << "Not inlining: " << F->getName() << "\n";
+      cerr << "Infinite (?) recursion halted\n";
+      cerr << "Not inlining: " << F->getName() << "\n";
       CN->dump();
       return;
     }
@@ -126,10 +126,10 @@ void FunctionDSGraph::computeClosure(const DataStructure &DS) {
     //
     
 #if 0
-    std::cerr << "\nSearching for: " << (void*)CN->getCall() << ": ";
+    cerr << "\nSearching for: " << (void*)CN->getCall() << ": ";
     for (unsigned X = 0; X != CN->getArgs().size(); ++X) {
-      std::cerr << " " << X << " is\n";
-      CN->getArgs().first[X].print(std::cerr);
+      cerr << " " << X << " is\n";
+      CN->getArgs().first[X].print(cerr);
     }
 #endif
 
@@ -137,9 +137,9 @@ void FunctionDSGraph::computeClosure(const DataStructure &DS) {
     PointerValSet *CMI = 0;
     for (unsigned i = 0, e = CallMap.size(); i != e; ++i) {
 #if 0
-      std::cerr << "Found: " << (void*)CallMap[i].first.second << ": ";
+      cerr << "Found: " << (void*)CallMap[i].first.second << ": ";
       for (unsigned X = 0; X != CallMap[i].first.first.size(); ++X) {
-        std::cerr << " " << X << " is\n"; CallMap[i].first.first[X].print(std::cerr);
+        cerr << " " << X << " is\n"; CallMap[i].first.first[X].print(cerr);
       }
 #endif
 
index 923bca5f34725d97dd34c4f9fda9e025d34c6e8f..7575a5da5bc96a8c95008d77879373ccbc52e565 100644 (file)
@@ -8,7 +8,6 @@
 #include "llvm/Module.h"
 #include <fstream>
 #include <algorithm>
-#include <iostream>
 
 //===----------------------------------------------------------------------===//
 // DataStructure Class Implementation
index 06385d4b12c8548b186f1547f1c2a2f8f433e134..7d8eb9b251e17a3adea91eac0b73f204214c78cc 100644 (file)
@@ -19,7 +19,7 @@
 #include "llvm/Value.h"
 #include "Support/STLExtras.h"
 #include <algorithm>
-#include <iostream>
+using std::vector;
 
 //#define DEBUG_NODE_ELIMINATE 1
 
@@ -40,7 +40,7 @@ static void DestroyFirstNodeOfPair(DSNode *N1, DSNode *N2) {
   // Now make sure that all of the nodes that point to N1 also point to the node
   // that we are merging it with...
   //
-  const std::vector<PointerValSet*> &Refs = N1->getReferrers();
+  const vector<PointerValSet*> &Refs = N1->getReferrers();
   for (unsigned i = 0, e = Refs.size(); i != e; ++i) {
     PointerValSet &PVS = *Refs[i];
 
@@ -79,7 +79,7 @@ static bool isIndistinguishableNode(DSNode *DN) {
   //
 
   DSNode *IndFrom = 0;
-  const std::vector<PointerValSet*> &Refs = DN->getReferrers();
+  const vector<PointerValSet*> &Refs = DN->getReferrers();
   for (unsigned R = 0, RE = Refs.size(); R != RE; ++R) {
     const PointerValSet &Ptr = *Refs[R];
 
@@ -126,9 +126,9 @@ static bool isIndistinguishableNode(DSNode *DN) {
 }
 
 template<typename NodeTy>
-static bool removeIndistinguishableNodes(std::vector<NodeTy*> &Nodes) {
+static bool removeIndistinguishableNodes(vector<NodeTy*> &Nodes) {
   bool Changed = false;
-  std::vector<NodeTy*>::iterator I = Nodes.begin();
+  vector<NodeTy*>::iterator I = Nodes.begin();
   while (I != Nodes.end()) {
     if (isIndistinguishableNode(*I)) {
       I = Nodes.erase(I);
@@ -141,12 +141,12 @@ static bool removeIndistinguishableNodes(std::vector<NodeTy*> &Nodes) {
 }
 
 template<typename NodeTy>
-static bool removeIndistinguishableNodePairs(std::vector<NodeTy*> &Nodes) {
+static bool removeIndistinguishableNodePairs(vector<NodeTy*> &Nodes) {
   bool Changed = false;
-  std::vector<NodeTy*>::iterator I = Nodes.begin();
+  vector<NodeTy*>::iterator I = Nodes.begin();
   while (I != Nodes.end()) {
     NodeTy *N1 = *I++;
-    for (std::vector<NodeTy*>::iterator I2 = I, I2E = Nodes.end();
+    for (vector<NodeTy*>::iterator I2 = I, I2E = Nodes.end();
          I2 != I2E; ++I2) {
       NodeTy *N2 = *I2;
       if (N1->isEquivalentTo(N2)) {
@@ -178,16 +178,16 @@ bool FunctionDSGraph::UnlinkUndistinguishableNodes() {
 }
 
 static void MarkReferredNodesReachable(DSNode *N,
-                                       std::vector<ShadowDSNode*> &ShadowNodes,
-                                       std::vector<bool> &ReachableShadowNodes,
-                                       std::vector<AllocDSNode*>  &AllocNodes,
-                                       std::vector<bool> &ReachableAllocNodes);
+                                       vector<ShadowDSNode*> &ShadowNodes,
+                                       vector<bool> &ReachableShadowNodes,
+                                       vector<AllocDSNode*>  &AllocNodes,
+                                       vector<bool> &ReachableAllocNodes);
 
 static inline void MarkReferredNodeSetReachable(const PointerValSet &PVS,
-                                            std::vector<ShadowDSNode*> &ShadowNodes,
-                                            std::vector<bool> &ReachableShadowNodes,
-                                            std::vector<AllocDSNode*>  &AllocNodes,
-                                            std::vector<bool> &ReachableAllocNodes) {
+                                            vector<ShadowDSNode*> &ShadowNodes,
+                                            vector<bool> &ReachableShadowNodes,
+                                            vector<AllocDSNode*>  &AllocNodes,
+                                            vector<bool> &ReachableAllocNodes) {
   for (unsigned i = 0, e = PVS.size(); i != e; ++i)
     if (isa<ShadowDSNode>(PVS[i].Node) || isa<AllocDSNode>(PVS[i].Node))
       MarkReferredNodesReachable(PVS[i].Node, ShadowNodes, ReachableShadowNodes,
@@ -195,21 +195,21 @@ static inline void MarkReferredNodeSetReachable(const PointerValSet &PVS,
 }
 
 static void MarkReferredNodesReachable(DSNode *N,
-                                       std::vector<ShadowDSNode*> &ShadowNodes,
-                                       std::vector<bool> &ReachableShadowNodes,
-                                       std::vector<AllocDSNode*>  &AllocNodes,
-                                       std::vector<bool> &ReachableAllocNodes) {
+                                       vector<ShadowDSNode*> &ShadowNodes,
+                                       vector<bool> &ReachableShadowNodes,
+                                       vector<AllocDSNode*>  &AllocNodes,
+                                       vector<bool> &ReachableAllocNodes) {
   assert(ShadowNodes.size() == ReachableShadowNodes.size());
   assert(AllocNodes.size()  == ReachableAllocNodes.size());
 
   if (ShadowDSNode *Shad = dyn_cast<ShadowDSNode>(N)) {
-    std::vector<ShadowDSNode*>::iterator I =
+    vector<ShadowDSNode*>::iterator I =
       std::find(ShadowNodes.begin(), ShadowNodes.end(), Shad);
     unsigned i = I-ShadowNodes.begin();
     if (ReachableShadowNodes[i]) return;  // Recursion detected, abort...
     ReachableShadowNodes[i] = true;
   } else if (AllocDSNode *Alloc = dyn_cast<AllocDSNode>(N)) {
-    std::vector<AllocDSNode*>::iterator I =
+    vector<AllocDSNode*>::iterator I =
       std::find(AllocNodes.begin(), AllocNodes.end(), Alloc);
     unsigned i = I-AllocNodes.begin();
     if (ReachableAllocNodes[i]) return;  // Recursion detected, abort...
@@ -221,7 +221,7 @@ static void MarkReferredNodesReachable(DSNode *N,
                                  ShadowNodes, ReachableShadowNodes,
                                  AllocNodes, ReachableAllocNodes);
 
-  const std::vector<PointerValSet> *Links = N->getAuxLinks();
+  const vector<PointerValSet> *Links = N->getAuxLinks();
   if (Links)
     for (unsigned i = 0, e = Links->size(); i != e; ++i)
       MarkReferredNodeSetReachable((*Links)[i],
@@ -230,8 +230,8 @@ static void MarkReferredNodesReachable(DSNode *N,
 }
 
 void FunctionDSGraph::MarkEscapeableNodesReachable(
-                                       std::vector<bool> &ReachableShadowNodes,
-                                       std::vector<bool> &ReachableAllocNodes) {
+                                       vector<bool> &ReachableShadowNodes,
+                                       vector<bool> &ReachableAllocNodes) {
   // Mark all shadow nodes that have edges from other nodes as reachable.  
   // Recursively mark any shadow nodes pointed to by the newly live shadow
   // nodes as also alive.
@@ -261,8 +261,8 @@ bool FunctionDSGraph::RemoveUnreachableNodes() {
     // Reachable*Nodes - Contains true if there is an edge from a reachable
     // node to the numbered node...
     //
-    std::vector<bool> ReachableShadowNodes(ShadowNodes.size());
-    std::vector<bool> ReachableAllocNodes (AllocNodes.size());
+    vector<bool> ReachableShadowNodes(ShadowNodes.size());
+    vector<bool> ReachableAllocNodes (AllocNodes.size());
     
     MarkEscapeableNodesReachable(ReachableShadowNodes, ReachableAllocNodes);
 
@@ -317,7 +317,7 @@ bool FunctionDSGraph::RemoveUnreachableNodes() {
   // Loop over the global nodes, removing nodes that have no edges into them or
   // out of them.
   // 
-  for (std::vector<GlobalDSNode*>::iterator I = GlobalNodes.begin();
+  for (vector<GlobalDSNode*>::iterator I = GlobalNodes.begin();
        I != GlobalNodes.end(); )
     if ((*I)->getReferrers().empty()) {
       GlobalDSNode *GDN = *I;
@@ -347,9 +347,9 @@ bool FunctionDSGraph::RemoveUnreachableNodes() {
 // getEscapingAllocations - Add all allocations that escape the current
 // function to the specified vector.
 //
-void FunctionDSGraph::getEscapingAllocations(std::vector<AllocDSNode*> &Allocs) {
-  std::vector<bool> ReachableShadowNodes(ShadowNodes.size());
-  std::vector<bool> ReachableAllocNodes (AllocNodes.size());
+void FunctionDSGraph::getEscapingAllocations(vector<AllocDSNode*> &Allocs) {
+  vector<bool> ReachableShadowNodes(ShadowNodes.size());
+  vector<bool> ReachableAllocNodes (AllocNodes.size());
     
   MarkEscapeableNodesReachable(ReachableShadowNodes, ReachableAllocNodes);
 
@@ -361,9 +361,9 @@ void FunctionDSGraph::getEscapingAllocations(std::vector<AllocDSNode*> &Allocs)
 // getNonEscapingAllocations - Add all allocations that do not escape the
 // current function to the specified vector.
 //
-void FunctionDSGraph::getNonEscapingAllocations(std::vector<AllocDSNode*> &Allocs) {
-  std::vector<bool> ReachableShadowNodes(ShadowNodes.size());
-  std::vector<bool> ReachableAllocNodes (AllocNodes.size());
+void FunctionDSGraph::getNonEscapingAllocations(vector<AllocDSNode*> &Allocs) {
+  vector<bool> ReachableShadowNodes(ShadowNodes.size());
+  vector<bool> ReachableAllocNodes (AllocNodes.size());
     
   MarkEscapeableNodesReachable(ReachableShadowNodes, ReachableAllocNodes);
 
index f90ab9ba604fa6aa164bfb2efa43cfa819c07fb7..be49eec177d47b9949c9cea35646e6fa20ff9bb6 100644 (file)
@@ -15,7 +15,6 @@
 #include "llvm/Constants.h"
 #include "Support/STLExtras.h"
 #include <algorithm>
-#include <iostream>
 
 // synthesizeNode - Create a new shadow node that is to be linked into this
 // chain..
index 30e0bb21b6bf0cf90d1486fed157c663532c8ca5..9965759fec41b4415aaa495c7e917b744a769210 100644 (file)
@@ -10,7 +10,6 @@
 
 #include "llvm/Analysis/DataStructure.h"
 #include "llvm/Support/InstVisitor.h"
-#include <iostream>
 
 // DEBUG_DATA_STRUCTURE_CONSTRUCTION - Define this to 1 if you want debug output
 //#define DEBUG_DATA_STRUCTURE_CONSTRUCTION 1
index b47b265814e0b59598bcd185dda4535e5ac302ab..1b3fb76505ea7eeadf6f5adbdd2c2a2a53ec426a 100644 (file)
@@ -13,7 +13,6 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 #include <sstream>
-#include <iostream>
 using std::map;
 using std::string;
 
@@ -128,7 +127,7 @@ DSNode::DSNode(enum NodeTy NT, const Type *T) : Ty(T), NodeType(NT) {
 
 void DSNode::removeReferrer(PointerValSet *PVS) {
   std::vector<PointerValSet*>::iterator I = std::find(Referrers.begin(),
-                                                     Referrers.end(), PVS);
+                                                      Referrers.end(), PVS);
   assert(I != Referrers.end() && "PVS not pointing to node!");
   Referrers.erase(I);
 }