Prevent repetitive warnings for unrecognized processors and features

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199886 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Artyom Skrobov
2014-01-23 11:31:38 +00:00
parent 1f0d177335
commit 93681fa6c6
4 changed files with 59 additions and 27 deletions

View File

@@ -96,14 +96,11 @@ MCSubtargetInfo::getSchedModelForCPU(StringRef CPU) const {
#endif
// Find entry
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";
const SubtargetInfoKV *Found = SubtargetFeatures::Find(CPU, ProcSchedModels,
NumProcs, "processor");
if (!Found)
return &MCSchedModel::DefaultSchedModel;
}
assert(Found->Value && "Missing processor SchedModel value");
return (const MCSchedModel *)Found->Value;
}