diff options
author | Derek Schuff <dschuff@chromium.org> | 2012-10-11 17:01:28 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2012-10-11 17:01:28 -0700 |
commit | 4db6bb7837c58641c4416e87643833bca4945841 (patch) | |
tree | 5f06f1dd5968c63c8e94cc077fd6016165ba0931 /lib/MC/SubtargetFeature.cpp | |
parent | 6b4efcb6bb663678c5cdd63a22e1ccc5ec6819f1 (diff) | |
parent | 2fa8af224ea026f9432e833fd6f42a216423a010 (diff) |
Merge commit '2fa8af224ea026f9432e833fd6f42a216423a010'
Conflicts:
lib/ExecutionEngine/JIT/JITEmitter.cpp
lib/MC/MCELFStreamer.cpp
lib/Target/ARM/ARMAsmPrinter.h
lib/Target/X86/X86RegisterInfo.td
lib/Target/X86/X86TargetMachine.cpp
tools/llc/llc.cpp
Diffstat (limited to 'lib/MC/SubtargetFeature.cpp')
-rw-r--r-- | lib/MC/SubtargetFeature.cpp | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/lib/MC/SubtargetFeature.cpp b/lib/MC/SubtargetFeature.cpp index e3a9d3fa52..e24514835b 100644 --- a/lib/MC/SubtargetFeature.cpp +++ b/lib/MC/SubtargetFeature.cpp @@ -119,14 +119,15 @@ void SubtargetFeatures::AddFeature(const StringRef String, } /// Find KV in array using binary search. -template<typename T> const T *Find(const StringRef S, const T *A, size_t L) { +const SubtargetFeatureKV *Find(const StringRef S, const SubtargetFeatureKV *A, + size_t L) { // Make the lower bound element we're looking for - T KV; + SubtargetFeatureKV KV; KV.Key = S.data(); // Determine the end of the array - const T *Hi = A + L; + const SubtargetFeatureKV *Hi = A + L; // Binary search the array - const T *F = std::lower_bound(A, Hi, KV); + const SubtargetFeatureKV *F = std::lower_bound(A, Hi, KV); // If not found then return NULL if (F == Hi || StringRef(F->Key) != S) return NULL; // Return the found array item @@ -336,30 +337,6 @@ uint64_t SubtargetFeatures::getFeatureBits(const StringRef CPU, return Bits; } -/// Get scheduling itinerary of a CPU. -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++) { - assert(strcmp(Table[i - 1].Key, Table[i].Key) < 0 && "Table is not sorted"); - } -#endif - - // Find entry - const SubtargetInfoKV *Entry = Find(CPU, Table, TableSize); - - if (Entry) { - return Entry->Value; - } else { - errs() << "'" << CPU - << "' is not a recognized processor for this target" - << " (ignoring processor)\n"; - return NULL; - } -} - /// print - Print feature string. /// void SubtargetFeatures::print(raw_ostream &OS) const { |