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
This commit is contained in:
Jeff Cohen
2006-01-26 20:41:32 +00:00
parent 4ccb070f15
commit 9471c8a93b
5 changed files with 21 additions and 8 deletions

View File

@@ -135,7 +135,8 @@ namespace {
Relation &getRelation(Value *V) {
// Binary search for V's entry...
std::vector<Relation>::iterator I =
std::lower_bound(Relationships.begin(), Relationships.end(), V);
std::lower_bound(Relationships.begin(), Relationships.end(),
Relation(V));
// If we found the entry, return it...
if (I != Relationships.end() && I->getValue() == V)
@@ -148,7 +149,8 @@ namespace {
const Relation *requestRelation(Value *V) const {
// Binary search for V's entry...
std::vector<Relation>::const_iterator I =
std::lower_bound(Relationships.begin(), Relationships.end(), V);
std::lower_bound(Relationships.begin(), Relationships.end(),
Relation(V));
if (I != Relationships.end() && I->getValue() == V)
return &*I;
return 0;