Just some code beautification changes I had sitting around in my tree.
authorMisha Brukman <brukman+llvm@gmail.com>
Tue, 22 Apr 2003 23:00:08 +0000 (23:00 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Tue, 22 Apr 2003 23:00:08 +0000 (23:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5859 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ModuloScheduling/ModuloSchedGraph.cpp
lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h
lib/Target/SparcV9/ModuloScheduling/ModuloSchedGraph.cpp
lib/Target/SparcV9/ModuloScheduling/ModuloSchedGraph.h

index a5db12f8fbec078297112116c33b4c214e9c339d..8bc78adc877eefe174a679f9eceaaaaf53a979be 100644 (file)
 #include <algorithm>
 #include <ostream>
 #include <vector>
-
 // FIXME: Should be using #include <cmath>
 #include <math.h>
 //#include <swig.h>
 
 #define UNIDELAY 1
 
-
 //*********************** Internal Data Structures *************************/
 
 // The following two types need to be classes, not typedefs, so we can use
@@ -52,7 +50,6 @@ struct ValueToDefVecMap:public hash_map<const Instruction*,RefVec> {
 
 // class Modulo SchedGraphNode
 
-/*ctor*/
 ModuloSchedGraphNode::ModuloSchedGraphNode(unsigned int _nodeId,
                                            const BasicBlock * _bb,
                                            const Instruction * _inst,
@@ -113,8 +110,8 @@ void ModuloSchedGraph::addDefUseEdges(const BasicBlock *bb)
   for (unsigned int i = 0; i < defVec.size(); i++) {
     for (Value::use_const_iterator I = defVec[i]->getInst()->use_begin();
          I != defVec[i]->getInst()->use_end(); I++) {
-      //for each use of a def, add a flow edge from the def instruction to the ref instruction
-
+      //for each use of a def, add a flow edge from the def instruction to the
+      //ref instruction
 
       const Instruction *value = defVec[i]->getInst();
       Instruction *inst = (Instruction *) (*I);
@@ -969,7 +966,6 @@ ModuloSchedGraphNode *ModuloSchedGraph::getNode(const unsigned nodeId) const
 
 int ModuloSchedGraph::computeRecII(const BasicBlock *bb)
 {
-
   int RecII = 0;
 
   //os<<"begining computerRecII()"<<"\n";
@@ -1269,7 +1265,6 @@ void ModuloSchedGraph::dump(const BasicBlock * bb)
   DEBUG(std::cerr << "dumping basic block:");
   DEBUG(std::cerr << (bb->hasName()? bb->getName() : "block")
         << " (" << bb << ")" << "\n");
-
 }
 
 void ModuloSchedGraph::dump(const BasicBlock * bb, std::ostream & os)
@@ -1319,16 +1314,15 @@ void ModuloSchedGraph::dumpNodeProperty() const
   }
 }
 
-void ModuloSchedGraphSet::buildGraphsForMethod(const Function * F,
-                                               const TargetMachine &
-                                               target)
+void ModuloSchedGraphSet::buildGraphsForMethod(const Function *F,
+                                               const TargetMachine &target)
 {
   for (Function::const_iterator BI = F->begin(); BI != F->end(); ++BI)
     addGraph(new ModuloSchedGraph(BI, target));
 }
 
-std::ostream & operator<<(std::ostream & os,
-                          const ModuloSchedGraphNode & node)
+std::ostream& operator<<(std::ostream &os,
+                         const ModuloSchedGraphNode &node)
 {
   os << std::string(8, ' ')
       << "Node " << node.nodeId << " : "
@@ -1348,6 +1342,5 @@ std::ostream & operator<<(std::ostream & os,
       os << std::string(16, ' ') << *node.outEdges[i];
   }
 
-
   return os;
 }
index 78718447e5f74d412774012c77ab73609cf2ae89..9fe40f2e1993d9ca18bf3d1c905722b10237c233 100644 (file)
@@ -235,14 +235,15 @@ public:
   const unsigned int getNumNodes() const {
     return size() + 2;
   }
+
   //return wether the BasicBlock 'bb' contains a loop
-  bool isLoop(const BasicBlock * bb);
+  bool isLoop(const BasicBlock *bb);
 
   //return this basibBlock contains a loop
   bool isLoop();
 
   //return the node for the input instruction
-  ModuloSchedGraphNode *getGraphNodeForInst(const Instruction * inst) const {
+  ModuloSchedGraphNode *getGraphNodeForInst(const Instruction *inst) const {
     const_iterator onePair = this->find(inst);
     return (onePair != this->end()) ? (*onePair).second : NULL;
   }
@@ -252,10 +253,10 @@ public:
   void dump() const;
 
   // dump the basicBlock
-  void dump(const BasicBlock * bb);
+  void dump(const BasicBlock *bb);
 
   //dump the basicBlock into 'os' stream
-  void dump(const BasicBlock * bb, std::ostream & os);
+  void dump(const BasicBlock *bb, std::ostream &os);
 
   //dump the node property
   void dumpNodeProperty() const;
@@ -287,14 +288,13 @@ public:
     (*this)[inst] = node;
   }
 
-  //Graph builder
-
+  // Graph builder
   ModuloSchedGraphNode *getNode(const unsigned nodeId) const;
 
-  //build the graph from the basicBlock
-  void buildGraph(const TargetMachine & target);
+  // Build the graph from the basicBlock
+  void buildGraph(const TargetMachine &target);
 
-  //Build nodes for BasicBlock
+  // Build nodes for BasicBlock
   void buildNodesforBB(const TargetMachine &target,
                        const BasicBlock *bb,
                        NodeVec &memNode,
index a5db12f8fbec078297112116c33b4c214e9c339d..8bc78adc877eefe174a679f9eceaaaaf53a979be 100644 (file)
 #include <algorithm>
 #include <ostream>
 #include <vector>
-
 // FIXME: Should be using #include <cmath>
 #include <math.h>
 //#include <swig.h>
 
 #define UNIDELAY 1
 
-
 //*********************** Internal Data Structures *************************/
 
 // The following two types need to be classes, not typedefs, so we can use
@@ -52,7 +50,6 @@ struct ValueToDefVecMap:public hash_map<const Instruction*,RefVec> {
 
 // class Modulo SchedGraphNode
 
-/*ctor*/
 ModuloSchedGraphNode::ModuloSchedGraphNode(unsigned int _nodeId,
                                            const BasicBlock * _bb,
                                            const Instruction * _inst,
@@ -113,8 +110,8 @@ void ModuloSchedGraph::addDefUseEdges(const BasicBlock *bb)
   for (unsigned int i = 0; i < defVec.size(); i++) {
     for (Value::use_const_iterator I = defVec[i]->getInst()->use_begin();
          I != defVec[i]->getInst()->use_end(); I++) {
-      //for each use of a def, add a flow edge from the def instruction to the ref instruction
-
+      //for each use of a def, add a flow edge from the def instruction to the
+      //ref instruction
 
       const Instruction *value = defVec[i]->getInst();
       Instruction *inst = (Instruction *) (*I);
@@ -969,7 +966,6 @@ ModuloSchedGraphNode *ModuloSchedGraph::getNode(const unsigned nodeId) const
 
 int ModuloSchedGraph::computeRecII(const BasicBlock *bb)
 {
-
   int RecII = 0;
 
   //os<<"begining computerRecII()"<<"\n";
@@ -1269,7 +1265,6 @@ void ModuloSchedGraph::dump(const BasicBlock * bb)
   DEBUG(std::cerr << "dumping basic block:");
   DEBUG(std::cerr << (bb->hasName()? bb->getName() : "block")
         << " (" << bb << ")" << "\n");
-
 }
 
 void ModuloSchedGraph::dump(const BasicBlock * bb, std::ostream & os)
@@ -1319,16 +1314,15 @@ void ModuloSchedGraph::dumpNodeProperty() const
   }
 }
 
-void ModuloSchedGraphSet::buildGraphsForMethod(const Function * F,
-                                               const TargetMachine &
-                                               target)
+void ModuloSchedGraphSet::buildGraphsForMethod(const Function *F,
+                                               const TargetMachine &target)
 {
   for (Function::const_iterator BI = F->begin(); BI != F->end(); ++BI)
     addGraph(new ModuloSchedGraph(BI, target));
 }
 
-std::ostream & operator<<(std::ostream & os,
-                          const ModuloSchedGraphNode & node)
+std::ostream& operator<<(std::ostream &os,
+                         const ModuloSchedGraphNode &node)
 {
   os << std::string(8, ' ')
       << "Node " << node.nodeId << " : "
@@ -1348,6 +1342,5 @@ std::ostream & operator<<(std::ostream & os,
       os << std::string(16, ' ') << *node.outEdges[i];
   }
 
-
   return os;
 }
index 78718447e5f74d412774012c77ab73609cf2ae89..9fe40f2e1993d9ca18bf3d1c905722b10237c233 100644 (file)
@@ -235,14 +235,15 @@ public:
   const unsigned int getNumNodes() const {
     return size() + 2;
   }
+
   //return wether the BasicBlock 'bb' contains a loop
-  bool isLoop(const BasicBlock * bb);
+  bool isLoop(const BasicBlock *bb);
 
   //return this basibBlock contains a loop
   bool isLoop();
 
   //return the node for the input instruction
-  ModuloSchedGraphNode *getGraphNodeForInst(const Instruction * inst) const {
+  ModuloSchedGraphNode *getGraphNodeForInst(const Instruction *inst) const {
     const_iterator onePair = this->find(inst);
     return (onePair != this->end()) ? (*onePair).second : NULL;
   }
@@ -252,10 +253,10 @@ public:
   void dump() const;
 
   // dump the basicBlock
-  void dump(const BasicBlock * bb);
+  void dump(const BasicBlock *bb);
 
   //dump the basicBlock into 'os' stream
-  void dump(const BasicBlock * bb, std::ostream & os);
+  void dump(const BasicBlock *bb, std::ostream &os);
 
   //dump the node property
   void dumpNodeProperty() const;
@@ -287,14 +288,13 @@ public:
     (*this)[inst] = node;
   }
 
-  //Graph builder
-
+  // Graph builder
   ModuloSchedGraphNode *getNode(const unsigned nodeId) const;
 
-  //build the graph from the basicBlock
-  void buildGraph(const TargetMachine & target);
+  // Build the graph from the basicBlock
+  void buildGraph(const TargetMachine &target);
 
-  //Build nodes for BasicBlock
+  // Build nodes for BasicBlock
   void buildNodesforBB(const TargetMachine &target,
                        const BasicBlock *bb,
                        NodeVec &memNode,