mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
Change MCSchedModel to be a struct of statically initialized data.
This removes static initializers from the backends which generate this data, and also makes this struct match the other Tablegen generated structs in behaviour Reviewed by Andy Trick and Chandler C git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216919 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
MCSchedModel MCSchedModel::DefaultSchedModel; // For unknown processors.
|
||||
|
||||
/// InitMCProcessorInfo - Set or change the CPU (optionally supplemented
|
||||
/// with feature string). Recompute feature bits and scheduling model.
|
||||
void
|
||||
@@ -33,7 +31,7 @@ MCSubtargetInfo::InitCPUSchedModel(StringRef CPU) {
|
||||
if (!CPU.empty())
|
||||
CPUSchedModel = getSchedModelForCPU(CPU);
|
||||
else
|
||||
CPUSchedModel = &MCSchedModel::DefaultSchedModel;
|
||||
CPUSchedModel = MCSchedModel::GetDefaultSchedModel();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -78,7 +76,7 @@ uint64_t MCSubtargetInfo::ToggleFeature(StringRef FS) {
|
||||
}
|
||||
|
||||
|
||||
const MCSchedModel *
|
||||
MCSchedModel
|
||||
MCSubtargetInfo::getSchedModelForCPU(StringRef CPU) const {
|
||||
assert(ProcSchedModels && "Processor machine model not available!");
|
||||
|
||||
@@ -97,15 +95,15 @@ MCSubtargetInfo::getSchedModelForCPU(StringRef CPU) const {
|
||||
errs() << "'" << CPU
|
||||
<< "' is not a recognized processor for this target"
|
||||
<< " (ignoring processor)\n";
|
||||
return &MCSchedModel::DefaultSchedModel;
|
||||
return MCSchedModel::GetDefaultSchedModel();
|
||||
}
|
||||
assert(Found->Value && "Missing processor SchedModel value");
|
||||
return (const MCSchedModel *)Found->Value;
|
||||
return *(const MCSchedModel *)Found->Value;
|
||||
}
|
||||
|
||||
InstrItineraryData
|
||||
MCSubtargetInfo::getInstrItineraryForCPU(StringRef CPU) const {
|
||||
const MCSchedModel *SchedModel = getSchedModelForCPU(CPU);
|
||||
const MCSchedModel SchedModel = getSchedModelForCPU(CPU);
|
||||
return InstrItineraryData(SchedModel, Stages, OperandCycles, ForwardingPaths);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user