diff options
Diffstat (limited to 'llvm/lib/MC/MCSubtargetInfo.cpp')
| -rw-r--r-- | llvm/lib/MC/MCSubtargetInfo.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCSubtargetInfo.cpp b/llvm/lib/MC/MCSubtargetInfo.cpp index ead7aa96d14..8d8e2900b67 100644 --- a/llvm/lib/MC/MCSubtargetInfo.cpp +++ b/llvm/lib/MC/MCSubtargetInfo.cpp @@ -96,11 +96,14 @@ MCSubtargetInfo::getSchedModelForCPU(StringRef CPU) const { #endif // Find entry - const SubtargetInfoKV *Found = SubtargetFeatures::Find(CPU, ProcSchedModels, - NumProcs, "processor"); - if (!Found) + const SubtargetInfoKV *Found = + std::lower_bound(ProcSchedModels, ProcSchedModels+NumProcs, CPU); + if (Found == ProcSchedModels+NumProcs || StringRef(Found->Key) != CPU) { + errs() << "'" << CPU + << "' is not a recognized processor for this target" + << " (ignoring processor)\n"; return &MCSchedModel::DefaultSchedModel; - + } assert(Found->Value && "Missing processor SchedModel value"); return (const MCSchedModel *)Found->Value; } |

