/// getSchedModelForCPU - Get the machine model of a CPU.
///
- MCSchedModel *getSchedModelForCPU(StringRef CPU) const;
+ const MCSchedModel *getSchedModelForCPU(StringRef CPU) const;
/// getInstrItineraryForCPU - Get scheduling itinerary of a CPU.
///
//
struct SubtargetInfoKV {
const char *Key; // K-V key string
- void *Value; // K-V pointer value
+ const void *Value; // K-V pointer value
// Compare routine for std binary search
bool operator<(const SubtargetInfoKV &S) const {
size_t FeatureTableSize);
/// Get scheduling itinerary of a CPU.
- void *getItinerary(const StringRef CPU,
- const SubtargetInfoKV *Table, size_t TableSize);
+ const void *getItinerary(const StringRef CPU,
+ const SubtargetInfoKV *Table, size_t TableSize);
/// Print feature string.
void print(raw_ostream &OS) const;
}
-MCSchedModel *
+const MCSchedModel *
MCSubtargetInfo::getSchedModelForCPU(StringRef CPU) const {
assert(ProcSchedModel && "Processor machine model not available!");
return &MCSchedModel::DefaultSchedModel;
}
assert(Found->Value && "Missing processor SchedModel value");
- return (MCSchedModel *)Found->Value;
+ return (const MCSchedModel *)Found->Value;
}
InstrItineraryData
MCSubtargetInfo::getInstrItineraryForCPU(StringRef CPU) const {
- MCSchedModel *SchedModel = getSchedModelForCPU(CPU);
+ const MCSchedModel *SchedModel = getSchedModelForCPU(CPU);
return InstrItineraryData(SchedModel, Stages, OperandCycles, ForwardingPaths);
}
}
/// Get scheduling itinerary of a CPU.
-void *SubtargetFeatures::getItinerary(const StringRef CPU,
- const SubtargetInfoKV *Table,
- size_t TableSize) {
+const void *SubtargetFeatures::getItinerary(const StringRef CPU,
+ const SubtargetInfoKV *Table,
+ size_t TableSize) {
assert(Table && "missing table");
#ifndef NDEBUG
for (size_t i = 1; i < TableSize; i++) {
// Emit as { "cpu", procinit },
OS << " { "
<< "\"" << Name << "\", "
- << "(void *)&" << ProcModelName;
+ << "(const void *)&" << ProcModelName;
OS << " }";