Use Function's arg_size() and size() methods.
[oota-llvm.git] / include / llvm / Target / TargetInstrItineraries.h
index 9b2bb666c610d9ea8c2f08b72102ac8d26d1b523..dbf2b65b9a9f9de95adc571537cfcc5790091957 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the James M. Laskey and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -16,9 +16,6 @@
 #ifndef LLVM_TARGET_TARGETINSTRITINERARIES_H
 #define LLVM_TARGET_TARGETINSTRITINERARIES_H
 
-#include "llvm/Support/Debug.h"
-#include <cassert>
-
 namespace llvm {
 
 //===----------------------------------------------------------------------===//
@@ -49,46 +46,35 @@ struct InstrItinerary {
 // Instruction itinerary Data - Itinerary data supplied by a subtarget to be
 // used by a target.
 //
-class InstrItineraryData {
-  InstrStage     *Stages;         // Array of stages selected
-  unsigned        NStages;        // Number of stages
-  InstrItinerary *Itineratries;   // Array of itineraries selected
-  unsigned        NItineraries;   // Number of itineraries (actually classes)
-
-public:
+struct InstrItineraryData {
+  const InstrStage     *Stages;         // Array of stages selected
+  const InstrItinerary *Itineratries;   // Array of itineraries selected
 
-  //
-  // Ctors.
-  //
-  InstrItineraryData()
-  : Stages(NULL), NStages(0), Itineratries(NULL), NItineraries(0)
-  {}
-  InstrItineraryData(InstrStage *S, unsigned NS, InstrItinerary *I, unsigned NI)
-  : Stages(S), NStages(NS), Itineratries(I), NItineraries(NI)
-  {}
+//
+// Ctors.
+//
+  InstrItineraryData() : Stages(0), Itineratries(0) {}
+  InstrItineraryData(const InstrStage *S, const InstrItinerary *I)
+    : Stages(S), Itineratries(I) {}
   
   //
   // isEmpty - Returns true if there are no itineraries.
   //
-  inline bool isEmpty() const { return NItineraries == 0; }
+  inline bool isEmpty() const { return Itineratries == 0; }
   
   //
   // begin - Return the first stage of the itinerary.
   // 
-  inline InstrStage *begin(unsigned ItinClassIndx) const {
-    assert(ItinClassIndx < NItineraries && "Itinerary index out of range");
+  inline const InstrStage *begin(unsigned ItinClassIndx) const {
     unsigned StageIdx = Itineratries[ItinClassIndx].First;
-    assert(StageIdx < NStages && "Stage index out of range");
     return Stages + StageIdx;
   }
 
   //
   // end - Return the last+1 stage of the itinerary.
   // 
-  inline InstrStage *end(unsigned ItinClassIndx) const {
-    assert(ItinClassIndx < NItineraries && "Itinerary index out of range");
+  inline const InstrStage *end(unsigned ItinClassIndx) const {
     unsigned StageIdx = Itineratries[ItinClassIndx].Last;
-    assert(StageIdx < NStages && "Stage index out of range");
     return Stages + StageIdx;
   }
 };