X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FEquivalenceClasses.h;h=771476c30361de7787835453fba5b3459c0d389c;hb=5449a1db40b75586c1daf70a14396295e7b3fe24;hp=bed99d3d20573b5b1e954d1b3a4413843403777b;hpb=7362ce08cb2c1f0b544b18dbc21630fb4baebcfc;p=oota-llvm.git diff --git a/include/llvm/ADT/EquivalenceClasses.h b/include/llvm/ADT/EquivalenceClasses.h index bed99d3d205..771476c3036 100644 --- a/include/llvm/ADT/EquivalenceClasses.h +++ b/include/llvm/ADT/EquivalenceClasses.h @@ -16,6 +16,7 @@ #define LLVM_ADT_EQUIVALENCECLASSES_H #include "llvm/Support/DataTypes.h" +#include #include namespace llvm { @@ -168,7 +169,7 @@ public: /// getOrInsertLeaderValue - Return the leader for the specified value that is /// in the set. If the member is not in the set, it is inserted, then /// returned. - const ElemTy &getOrInsertLeaderValue(const ElemTy &V) const { + const ElemTy &getOrInsertLeaderValue(const ElemTy &V) { member_iterator MI = findLeader(insert(V)); assert(MI != member_end() && "Value is not in the set!"); return *MI; @@ -190,7 +191,7 @@ public: /// insert - Insert a new value into the union/find set, ignoring the request /// if the value already exists. iterator insert(const ElemTy &Data) { - return TheMapping.insert(Data).first; + return TheMapping.insert(ECValue(Data)).first; } /// findLeader - Given a value in the set, return a member iterator for the @@ -234,8 +235,9 @@ public: } class member_iterator : public std::iterator { - typedef std::iterator super; + const ElemTy, ptrdiff_t> { + typedef std::iterator super; const ECValue *Node; friend class EquivalenceClasses; public: @@ -249,7 +251,7 @@ public: reference operator*() const { assert(Node != 0 && "Dereferencing end()!"); - return const_cast(Node->getData()); // FIXME + return Node->getData(); } reference operator->() const { return operator*(); }