Don't crash when target has no itineraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80962 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Goodwin 2009-09-03 22:48:51 +00:00
parent eb3a766529
commit 4f7228f851

View File

@ -83,6 +83,7 @@ void ExactHazardRecognizer::dumpScoreboard() {
}
ExactHazardRecognizer::HazardType ExactHazardRecognizer::getHazardType(SUnit *SU) {
if (!ItinData.isEmpty()) {
unsigned cycle = 0;
// Use the itinerary for the underlying instruction to check for
@ -110,11 +111,13 @@ ExactHazardRecognizer::HazardType ExactHazardRecognizer::getHazardType(SUnit *SU
// Advance the cycle to the next stage.
cycle += IS->getNextCycles();
}
}
return NoHazard;
}
void ExactHazardRecognizer::EmitInstruction(SUnit *SU) {
if (!ItinData.isEmpty()) {
unsigned cycle = 0;
// Use the itinerary for the underlying instruction to reserve FU's
@ -148,6 +151,7 @@ void ExactHazardRecognizer::EmitInstruction(SUnit *SU) {
}
DEBUG(dumpScoreboard());
}
}
void ExactHazardRecognizer::AdvanceCycle() {