diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-29 15:08:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-29 15:08:33 +0000 |
commit | f0afa50b6c6d3c24d1d423e05b85c75701271710 (patch) | |
tree | 1aee26b594be24762ab1cd6d5d4e3458a1adccc2 /include/llvm/User.h | |
parent | 1ff1da7ac9bff43ba24445ff30ba2fd79bd95cd7 (diff) | |
download | llvm-f0afa50b6c6d3c24d1d423e05b85c75701271710.tar.gz llvm-f0afa50b6c6d3c24d1d423e05b85c75701271710.tar.bz2 llvm-f0afa50b6c6d3c24d1d423e05b85c75701271710.tar.xz |
Don't require the user to do something like isa<foo>(II->get()). The ->get
should be implicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/User.h')
-rw-r--r-- | include/llvm/User.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/User.h b/include/llvm/User.h index e9dea8bcbf..ce68c410e6 100644 --- a/include/llvm/User.h +++ b/include/llvm/User.h @@ -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 |