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 | 15a8c15a1ff03b88ad93b9015b2a86dd10f035b8 (patch) | |
tree | cfc11981b65d0a29fb28f3048519adabefe5f3fb /llvm/lib/Target/SubtargetFeature.cpp | |
parent | 32fef53f5cf5b5c9734f5472e5e53a6a8ffbcea3 (diff) | |
download | bcm5719-llvm-15a8c15a1ff03b88ad93b9015b2a86dd10f035b8.tar.gz bcm5719-llvm-15a8c15a1ff03b88ad93b9015b2a86dd10f035b8.zip |
Improve compatibility with VC2005, patch by Morten Ofstad!
llvm-svn: 25661
Diffstat (limited to 'llvm/lib/Target/SubtargetFeature.cpp')
-rw-r--r-- | llvm/lib/Target/SubtargetFeature.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/SubtargetFeature.cpp b/llvm/lib/Target/SubtargetFeature.cpp index c9ddaf74b8b..7856ddb66a4 100644 --- a/llvm/lib/Target/SubtargetFeature.cpp +++ b/llvm/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 |