X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FMC%2FSubtargetFeature.cpp;h=2fb91f2125b1bdf1a908876b60a9567f75396c5a;hb=5f59fe577485312a86debc48c7f310ea9265c201;hp=378c4184a834c04aa63c6b61682ad04047ce8fea;hpb=266eff8539116261b3cc0775205a34663afecb52;p=oota-llvm.git diff --git a/lib/MC/SubtargetFeature.cpp b/lib/MC/SubtargetFeature.cpp index 378c4184a83..2fb91f2125b 100644 --- a/lib/MC/SubtargetFeature.cpp +++ b/lib/MC/SubtargetFeature.cpp @@ -119,15 +119,12 @@ void SubtargetFeatures::AddFeature(const StringRef String, } /// Find KV in array using binary search. -const SubtargetFeatureKV *Find(const StringRef S, const SubtargetFeatureKV *A, - size_t L) { - // Make the lower bound element we're looking for - SubtargetFeatureKV KV; - KV.Key = S.data(); +static const SubtargetFeatureKV *Find(StringRef S, const SubtargetFeatureKV *A, + size_t L) { // Determine the end of the array const SubtargetFeatureKV *Hi = A + L; // Binary search the array - const SubtargetFeatureKV *F = std::lower_bound(A, Hi, KV); + const SubtargetFeatureKV *F = std::lower_bound(A, Hi, S); // If not found then return NULL if (F == Hi || StringRef(F->Key) != S) return NULL; // Return the found array item @@ -353,8 +350,7 @@ void SubtargetFeatures::dump() const { } #endif -/// getDefaultSubtargetFeatures - Return a string listing the features -/// associated with the target triple. +/// Adds the default features for the specified target triple. /// /// FIXME: This is an inelegant way of specifying the features of a /// subtarget. It would be better if we could encode this information