* Order #includes as per style guide
authorMisha Brukman <brukman+llvm@gmail.com>
Thu, 23 Oct 2003 18:03:50 +0000 (18:03 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Thu, 23 Oct 2003 18:03:50 +0000 (18:03 +0000)
* Doxygen-ify comments
* Make code layout more consistent

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9431 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAlloc/LiveRange.h
lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
lib/CodeGen/RegAlloc/LiveRangeInfo.h
lib/Target/SparcV9/RegAlloc/LiveRange.h
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h

index c06cfdc9213a74e770145079a9fb06771c382eb4..aa409c63fbcc2fd508b7d849694e4369a7456f45 100644 (file)
 #ifndef LIVERANGE_H
 #define LIVERANGE_H
 
-#include "llvm/CodeGen/ValueSet.h"
 #include "llvm/Value.h"
+#include "llvm/CodeGen/ValueSet.h"
 
 class RegClass;
 class IGNode;
 
 class LiveRange : public ValueSet {
-  RegClass *MyRegClass;       // register classs (e.g., int, FP) for this LR
+  RegClass *MyRegClass;       // register class (e.g., int, FP) for this LR
 
-  // doesSpanAcrossCalls - Does this live range span across calls? 
-  // This information is used by graph
-  // coloring algo to avoid allocating volatile colors to live ranges
-  // that span across calls (since they have to be saved/restored)
-  //
+  /// doesSpanAcrossCalls - Does this live range span across calls? 
+  /// This information is used by graph coloring algo to avoid allocating
+  /// volatile colors to live ranges that span across calls (since they have to
+  /// be saved/restored)
+  ///
   bool doesSpanAcrossCalls;
 
   IGNode *UserIGNode;         // IGNode which uses this LR
   int Color;                  // color assigned to this live range
   bool mustSpill;             // whether this LR must be spilt
 
-  // mustSaveAcrossCalls - whether this LR must be saved accross calls
-  // ***TODO REMOVE this
-  //
+  /// mustSaveAcrossCalls - whether this LR must be saved accross calls
+  /// ***TODO REMOVE this
+  ///
   bool mustSaveAcrossCalls;        
   
-  // SuggestedColor - if this LR has a suggested color, can it be
-  // really alloated?  A suggested color cannot be allocated when the
-  // suggested color is volatile and when there are call
-  // interferences.
-  //
+  /// SuggestedColor - if this LR has a suggested color, can it be
+  /// really alloated?  A suggested color cannot be allocated when the
+  /// suggested color is volatile and when there are call
+  /// interferences.
+  ///
   int SuggestedColor;        // The suggested color for this LR
 
-  // CanUseSuggestedCol - It is possible that a suggested color for
-  // this live range is not available before graph coloring (e.g., it
-  // can be allocated to another live range which interferes with
-  // this)
-  // 
+  /// CanUseSuggestedCol - It is possible that a suggested color for
+  /// this live range is not available before graph coloring (e.g., it
+  /// can be allocated to another live range which interferes with
+  /// this)
+  /// 
   bool CanUseSuggestedCol;
 
-  // SpilledStackOffsetFromFP - If this LR is spilled, its stack
-  // offset from *FP*. The spilled offsets must always be relative to
-  // the FP.
-  //
+  /// SpilledStackOffsetFromFP - If this LR is spilled, its stack
+  /// offset from *FP*. The spilled offsets must always be relative to
+  /// the FP.
+  ///
   int SpilledStackOffsetFromFP;
 
-  // HasSpillOffset 0 Whether this live range has a spill offset
-  //
+  /// HasSpillOffset 0 Whether this live range has a spill offset
+  ///
   bool HasSpillOffset;
 
-  // The spill cost of this live range. Calculated using loop depth of
-  // each reference to each Value in the live range
-  //
+  /// The spill cost of this live range. Calculated using loop depth of
+  /// each reference to each Value in the live range
+  ///
   unsigned SpillCost;
 
 public:
index 0f7958c88e4b289cbd0fbccb8d5d7f5a3eb86920..b9fcda789f78c7621990784b5f3ac18cc24270cc 100644 (file)
 // 
 //===----------------------------------------------------------------------===//
 
+#include "IGNode.h"
 #include "LiveRangeInfo.h"
 #include "RegAllocCommon.h"
 #include "RegClass.h"
-#include "IGNode.h"
+#include "llvm/Function.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetRegInfo.h"
-#include "llvm/Function.h"
 #include "Support/SetOperations.h"
 
 unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
@@ -217,7 +217,6 @@ void LiveRangeInfo::constructLiveRanges() {
        }
 
     } // for all machine instructions in the BB
-
   } // for all BBs in function
 
   // Now we have to suggest clors for call and return arg live ranges.
@@ -278,8 +277,7 @@ void LiveRangeInfo::suggestRegs4CallRets() {
 // Checks if live range LR interferes with any node assigned or suggested to
 // be assigned the specified color
 // 
-inline bool InterferesWithColor(const LiveRange& LR, unsigned color)
-{
+inline bool InterferesWithColor(const LiveRange& LR, unsigned color) {
   IGNode* lrNode = LR.getUserIGNode();
   for (unsigned n=0, NN = lrNode->getNumOfNeighbors(); n < NN; n++) {
     LiveRange *neighLR = lrNode->getAdjIGNode(n)->getParentLR();
@@ -299,8 +297,7 @@ inline bool InterferesWithColor(const LiveRange& LR, unsigned color)
 // (4) LR2 has color and LR1 interferes with any LR that has the same color
 // 
 inline bool InterfsPreventCoalescing(const LiveRange& LROfDef,
-                                     const LiveRange& LROfUse)
-{
+                                     const LiveRange& LROfUse) {
   // (4) if they have different suggested colors, cannot coalesce
   if (LROfDef.hasSuggestedColor() && LROfUse.hasSuggestedColor())
     return true;
index a9cb349af59ed8c6b88f6917b0614ea12ac9f038..5c5244bd62cfdd4c14da37a7589b3b8f5b8c9552 100644 (file)
@@ -87,20 +87,22 @@ public:
                std::vector<RegClass *> & RCList);
 
 
-  // Destructor to destroy all LiveRanges in the LiveRange Map
+  /// Destructor to destroy all LiveRanges in the LiveRange Map
+  ///
   ~LiveRangeInfo();
 
   // Main entry point for live range construction
   //
   void constructLiveRanges();
   
-  // return the common live range map for this method
-  //
+  /// return the common live range map for this method
+  ///
   inline const LiveRangeMapType *getLiveRangeMap() const 
     { return &LiveRangeMap; }
 
-  // Method used to get the live range containing a Value.
-  // This may return NULL if no live range exists for a Value (eg, some consts)
+  /// Method used to get the live range containing a Value.
+  /// This may return NULL if no live range exists for a Value (eg, some consts)
+  ///
   inline LiveRange *getLiveRangeForValue(const Value *Val) {
     return LiveRangeMap[Val];
   }
@@ -109,13 +111,13 @@ public:
     return I->second;
   }
 
-  // Method for coalescing live ranges. Called only after interference info
-  // is calculated.
-  //
+  /// Method for coalescing live ranges. Called only after interference info
+  /// is calculated.
+  ///
   void coalesceLRs();  
 
-  // debugging method to print the live ranges
-  //
+  /// debugging method to print the live ranges
+  ///
   void printLiveRanges();
 };
 
index c06cfdc9213a74e770145079a9fb06771c382eb4..aa409c63fbcc2fd508b7d849694e4369a7456f45 100644 (file)
 #ifndef LIVERANGE_H
 #define LIVERANGE_H
 
-#include "llvm/CodeGen/ValueSet.h"
 #include "llvm/Value.h"
+#include "llvm/CodeGen/ValueSet.h"
 
 class RegClass;
 class IGNode;
 
 class LiveRange : public ValueSet {
-  RegClass *MyRegClass;       // register classs (e.g., int, FP) for this LR
+  RegClass *MyRegClass;       // register class (e.g., int, FP) for this LR
 
-  // doesSpanAcrossCalls - Does this live range span across calls? 
-  // This information is used by graph
-  // coloring algo to avoid allocating volatile colors to live ranges
-  // that span across calls (since they have to be saved/restored)
-  //
+  /// doesSpanAcrossCalls - Does this live range span across calls? 
+  /// This information is used by graph coloring algo to avoid allocating
+  /// volatile colors to live ranges that span across calls (since they have to
+  /// be saved/restored)
+  ///
   bool doesSpanAcrossCalls;
 
   IGNode *UserIGNode;         // IGNode which uses this LR
   int Color;                  // color assigned to this live range
   bool mustSpill;             // whether this LR must be spilt
 
-  // mustSaveAcrossCalls - whether this LR must be saved accross calls
-  // ***TODO REMOVE this
-  //
+  /// mustSaveAcrossCalls - whether this LR must be saved accross calls
+  /// ***TODO REMOVE this
+  ///
   bool mustSaveAcrossCalls;        
   
-  // SuggestedColor - if this LR has a suggested color, can it be
-  // really alloated?  A suggested color cannot be allocated when the
-  // suggested color is volatile and when there are call
-  // interferences.
-  //
+  /// SuggestedColor - if this LR has a suggested color, can it be
+  /// really alloated?  A suggested color cannot be allocated when the
+  /// suggested color is volatile and when there are call
+  /// interferences.
+  ///
   int SuggestedColor;        // The suggested color for this LR
 
-  // CanUseSuggestedCol - It is possible that a suggested color for
-  // this live range is not available before graph coloring (e.g., it
-  // can be allocated to another live range which interferes with
-  // this)
-  // 
+  /// CanUseSuggestedCol - It is possible that a suggested color for
+  /// this live range is not available before graph coloring (e.g., it
+  /// can be allocated to another live range which interferes with
+  /// this)
+  /// 
   bool CanUseSuggestedCol;
 
-  // SpilledStackOffsetFromFP - If this LR is spilled, its stack
-  // offset from *FP*. The spilled offsets must always be relative to
-  // the FP.
-  //
+  /// SpilledStackOffsetFromFP - If this LR is spilled, its stack
+  /// offset from *FP*. The spilled offsets must always be relative to
+  /// the FP.
+  ///
   int SpilledStackOffsetFromFP;
 
-  // HasSpillOffset 0 Whether this live range has a spill offset
-  //
+  /// HasSpillOffset 0 Whether this live range has a spill offset
+  ///
   bool HasSpillOffset;
 
-  // The spill cost of this live range. Calculated using loop depth of
-  // each reference to each Value in the live range
-  //
+  /// The spill cost of this live range. Calculated using loop depth of
+  /// each reference to each Value in the live range
+  ///
   unsigned SpillCost;
 
 public:
index 0f7958c88e4b289cbd0fbccb8d5d7f5a3eb86920..b9fcda789f78c7621990784b5f3ac18cc24270cc 100644 (file)
 // 
 //===----------------------------------------------------------------------===//
 
+#include "IGNode.h"
 #include "LiveRangeInfo.h"
 #include "RegAllocCommon.h"
 #include "RegClass.h"
-#include "IGNode.h"
+#include "llvm/Function.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetRegInfo.h"
-#include "llvm/Function.h"
 #include "Support/SetOperations.h"
 
 unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
@@ -217,7 +217,6 @@ void LiveRangeInfo::constructLiveRanges() {
        }
 
     } // for all machine instructions in the BB
-
   } // for all BBs in function
 
   // Now we have to suggest clors for call and return arg live ranges.
@@ -278,8 +277,7 @@ void LiveRangeInfo::suggestRegs4CallRets() {
 // Checks if live range LR interferes with any node assigned or suggested to
 // be assigned the specified color
 // 
-inline bool InterferesWithColor(const LiveRange& LR, unsigned color)
-{
+inline bool InterferesWithColor(const LiveRange& LR, unsigned color) {
   IGNode* lrNode = LR.getUserIGNode();
   for (unsigned n=0, NN = lrNode->getNumOfNeighbors(); n < NN; n++) {
     LiveRange *neighLR = lrNode->getAdjIGNode(n)->getParentLR();
@@ -299,8 +297,7 @@ inline bool InterferesWithColor(const LiveRange& LR, unsigned color)
 // (4) LR2 has color and LR1 interferes with any LR that has the same color
 // 
 inline bool InterfsPreventCoalescing(const LiveRange& LROfDef,
-                                     const LiveRange& LROfUse)
-{
+                                     const LiveRange& LROfUse) {
   // (4) if they have different suggested colors, cannot coalesce
   if (LROfDef.hasSuggestedColor() && LROfUse.hasSuggestedColor())
     return true;
index a9cb349af59ed8c6b88f6917b0614ea12ac9f038..5c5244bd62cfdd4c14da37a7589b3b8f5b8c9552 100644 (file)
@@ -87,20 +87,22 @@ public:
                std::vector<RegClass *> & RCList);
 
 
-  // Destructor to destroy all LiveRanges in the LiveRange Map
+  /// Destructor to destroy all LiveRanges in the LiveRange Map
+  ///
   ~LiveRangeInfo();
 
   // Main entry point for live range construction
   //
   void constructLiveRanges();
   
-  // return the common live range map for this method
-  //
+  /// return the common live range map for this method
+  ///
   inline const LiveRangeMapType *getLiveRangeMap() const 
     { return &LiveRangeMap; }
 
-  // Method used to get the live range containing a Value.
-  // This may return NULL if no live range exists for a Value (eg, some consts)
+  /// Method used to get the live range containing a Value.
+  /// This may return NULL if no live range exists for a Value (eg, some consts)
+  ///
   inline LiveRange *getLiveRangeForValue(const Value *Val) {
     return LiveRangeMap[Val];
   }
@@ -109,13 +111,13 @@ public:
     return I->second;
   }
 
-  // Method for coalescing live ranges. Called only after interference info
-  // is calculated.
-  //
+  /// Method for coalescing live ranges. Called only after interference info
+  /// is calculated.
+  ///
   void coalesceLRs();  
 
-  // debugging method to print the live ranges
-  //
+  /// debugging method to print the live ranges
+  ///
   void printLiveRanges();
 };