Improve compatibility with VC2005, patch by Morten Ofstad!
[oota-llvm.git] / lib / Transforms / Scalar / CorrelatedExprs.cpp
index d00614b5d3dac7eda0d50f4cd671ec6a13861d68..3da7e6e2df572da6701c71c289f898b42223b28b 100644 (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;