diff options
author | Jeff Cohen <jeffc@jolt-lang.org> | 2006-01-26 20:41:32 +0000 |
---|---|---|
committer | Jeff Cohen <jeffc@jolt-lang.org> | 2006-01-26 20:41:32 +0000 |
commit | 9471c8a93b117d8ac01c4ef1cb9faa583e03dec0 (patch) | |
tree | 4cebe10aa3a8220b4bf6d1c4ff31487463bcdeb0 /lib/Target/SubtargetFeature.cpp | |
parent | 4ccb070f158b0f331c68de800c6bab8c31c2ecb6 (diff) |
Improve compatibility with VC2005, patch by Morten Ofstad!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SubtargetFeature.cpp')
-rw-r--r-- | lib/Target/SubtargetFeature.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/SubtargetFeature.cpp b/lib/Target/SubtargetFeature.cpp index c9ddaf74b8..7856ddb66a 100644 --- a/lib/Target/SubtargetFeature.cpp +++ b/lib/Target/SubtargetFeature.cpp @@ -112,10 +112,13 @@ void SubtargetFeatures::AddFeature(const std::string &String, /// Find KV in array using binary search. template<typename T> const T *Find(const std::string &S, const T *A, size_t L) { + // Make the lower bound element we're looking for + T KV; + KV.Key = S.c_str(); // Determine the end of the array const T *Hi = A + L; // Binary search the array - const T *F = std::lower_bound(A, Hi, S); + const T *F = std::lower_bound(A, Hi, KV); // If not found then return NULL if (F == Hi || std::string(F->Key) != S) return NULL; // Return the found array item |