diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-23 08:36:07 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-23 08:36:07 +0000 |
commit | 4a3bb24179b3f0c0daa6a8f10a3f43721895c499 (patch) | |
tree | 0a48ad29a751ae0d6d5dd99efef63e4ae10c103e /include | |
parent | 7d455eb7a4de7d92b75c1a6275f5a3a0a7b65527 (diff) | |
download | external_llvm-4a3bb24179b3f0c0daa6a8f10a3f43721895c499.zip external_llvm-4a3bb24179b3f0c0daa6a8f10a3f43721895c499.tar.gz external_llvm-4a3bb24179b3f0c0daa6a8f10a3f43721895c499.tar.bz2 |
Simplifying use_iterators by dereferencing
is not a good idea. The codebase does not depend
in this any more, and it may introduce hidden
runtime cost. If you get compile errors, please
dereference your iterator before passing to cast<>
(and friends).
Also: please consider caching the result of
operator* and reusing that instead of dereferencing
many times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Use.h | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/include/llvm/Use.h b/include/llvm/Use.h index 2759338..e1ebc6a 100644 --- a/include/llvm/Use.h +++ b/include/llvm/Use.h @@ -210,30 +210,6 @@ public: unsigned getOperandNo() const; }; - -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 |