Changes For Bug 352
[oota-llvm.git] / lib / Target / SparcV9 / InstrSched / SchedPriorities.h
index b01c1a43d6803b6dd0f3bd26fcadf728390cac35..dd807f788e3c326769f6e3675dc27b38da7d11a0 100644 (file)
@@ -1,10 +1,11 @@
-// -*-C++-*-
-//***************************************************************************
-// File:
-//     SchedPriorities.h
+//===-- SchedPriorities.h - Encapsulate scheduling heuristics --*- C++ -*--===//
 // 
-// Purpose:
-//     Encapsulate heuristics for instruction scheduling.
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 // 
 // Strategy:
 //    Priority ordering rules:
 //    (3) Instruction that has the maximum number of dependent instructions.
 //    Note that rules 2 and 3 are only used if issue conflicts prevent
 //    choosing a higher priority instruction by rule 1.
-// 
-// History:
-//     7/30/01  -  Vikram Adve  -  Created
-//**************************************************************************/
+//
+//===----------------------------------------------------------------------===//
 
 #ifndef LLVM_CODEGEN_SCHEDPRIORITIES_H
 #define LLVM_CODEGEN_SCHEDPRIORITIES_H
 
 #include "SchedGraph.h"
 #include "llvm/CodeGen/InstrScheduling.h"
-#include "llvm/Target/MachineSchedInfo.h"
+#include "llvm/Target/TargetSchedInfo.h"
+#include "llvm/ADT/hash_set"
 #include <list>
-#include <Support/hash_set>
-#include <iostream>
+
+namespace llvm {
+
 class Function;
 class MachineInstr;
 class SchedulingManager;
@@ -71,7 +72,9 @@ NDPLessThan(const NodeDelayPair* np1, const NodeDelayPair* np2)
   return np1->delay < np2->delay;
 }
 
-class NodeHeap: public std::list<NodeDelayPair*>, public NonCopyable {
+class NodeHeap : public std::list<NodeDelayPair*> {
+  NodeHeap(const NodeHeap&);          // DO NOT IMPLEMENT
+  void operator=(const NodeHeap&);    // DO NOT IMPLEMENT
 public:
   typedef std::list<NodeDelayPair*>::iterator iterator;
   typedef std::list<NodeDelayPair*>::const_iterator const_iterator;
@@ -123,7 +126,9 @@ private:
 };
 
 
-class SchedPriorities: public NonCopyable {
+class SchedPriorities {
+  SchedPriorities(const SchedPriorities&); // DO NOT IMPLEMENT
+  void operator=(const SchedPriorities &); // DO NOT IMPLEMENT
 public:
   SchedPriorities(const Function *F, const SchedGraph *G,
                   FunctionLiveVarInfo &LVI);
@@ -157,13 +162,13 @@ private:
   cycles_t curTime;
   const SchedGraph* graph;
   FunctionLiveVarInfo &methodLiveVarInfo;
-  std::hash_map<const MachineInstr*, bool> lastUseMap;
+  hash_map<const MachineInstr*, bool> lastUseMap;
   std::vector<cycles_t> nodeDelayVec;
   std::vector<cycles_t> nodeEarliestUseVec;
   std::vector<cycles_t> earliestReadyTimeForNode;
   cycles_t earliestReadyTime;
   NodeHeap candsAsHeap;                                // candidate nodes, ready to go
-  std::hash_set<const SchedGraphNode*> candsAsSet;//same entries as candsAsHeap,
+  hash_set<const SchedGraphNode*> candsAsSet;   //same entries as candsAsHeap,
                                                //   but as set for fast lookup
   std::vector<candIndex> mcands;                // holds pointers into cands
   candIndex nextToTry;                         // next cand after the last
@@ -209,9 +214,8 @@ inline void SchedPriorities::updateTime(cycles_t c) {
   mcands.clear();
 }
 
-inline std::ostream &operator<<(std::ostream &os, const NodeDelayPair* nd) {
-  return os << "Delay for node " << nd->node->getNodeId()
-           << " = " << (long)nd->delay << "\n";
-}
+std::ostream &operator<<(std::ostream &os, const NodeDelayPair* nd);
+
+} // End llvm namespace
 
 #endif