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.

llvm-svn: 109220
This commit is contained in:
Gabor Greif 2010-07-23 08:36:07 +00:00
parent 8abd1ca8d2
commit 1025f21ef3
1 changed files with 0 additions and 24 deletions

View File

@ -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