diff options
author | Chris Lattner <sabre@nondot.org> | 2006-03-27 22:49:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-03-27 22:49:07 +0000 |
commit | 5dc8050ca3797d7001d05ade44bae199bbe324cf (patch) | |
tree | d8f005f8104b122c9f1378fd444a1af68a9953f0 | |
parent | 8850a1bcef0c2a785f918395fe0a05054914b349 (diff) |
Add some missing template specializations for autodereferencing User.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27189 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Use.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/include/llvm/Use.h b/include/llvm/Use.h index d36e66fe06..eeff52fcb6 100644 --- a/include/llvm/Use.h +++ b/include/llvm/Use.h @@ -132,7 +132,7 @@ public: } // Retrieve a reference to the current SCC - UserTy *operator*() const { + UserTy *operator*() const { assert(U && "Cannot increment end iterator!"); return U->getUser(); } @@ -142,6 +142,30 @@ public: Use &getUse() const { return *U; } }; + +template<> struct simplify_type<value_use_iterator<User> > { + typedef User* SimpleType; + + static SimpleType getSimplifiedValue(const value_use_iterator<User> &Val) { + return *Val; + } +}; + +template<> struct simplify_type<const value_use_iterator<User> > + : public simplify_type<value_use_iterator<User> > {}; + +template<> struct simplify_type<value_use_iterator<const User> > { + typedef const User* SimpleType; + + static SimpleType getSimplifiedValue(const + value_use_iterator<const User> &Val) { + return *Val; + } +}; + +template<> struct simplify_type<const value_use_iterator<const User> > + : public simplify_type<value_use_iterator<const User> > {}; + } // End llvm namespace #endif |