Don't require the user to do something like isa<foo>(II->get()). The ->get
authorChris Lattner <sabre@nondot.org>
Thu, 29 May 2003 15:08:33 +0000 (15:08 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 29 May 2003 15:08:33 +0000 (15:08 +0000)
should be implicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6395 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/User.h

index e9dea8bcbff7b84908e348a8ea10de717b323c9b..ce68c410e6787a1f8ff1b697a013f1151e21cbd4 100644 (file)
@@ -73,4 +73,24 @@ public:
   }
 };
 
+template<> struct simplify_type<User::op_iterator> {
+  typedef Value* SimpleType;
+  
+  static SimpleType getSimplifiedValue(const User::op_iterator &Val) {
+    return (SimpleType)Val->get();
+  }
+};
+template<> struct simplify_type<const User::op_iterator>
+  : public simplify_type<User::op_iterator> {};
+
+template<> struct simplify_type<User::const_op_iterator> {
+  typedef Value* SimpleType;
+  
+  static SimpleType getSimplifiedValue(const User::const_op_iterator &Val) {
+    return (SimpleType)Val->get();
+  }
+};
+template<> struct simplify_type<const User::const_op_iterator>
+  : public simplify_type<User::const_op_iterator> {};
+
 #endif