From: Gabor Greif Date: Fri, 23 Jul 2010 08:36:07 +0000 (+0000) Subject: Simplifying use_iterators by dereferencing X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4a3bb24179b3f0c0daa6a8f10a3f43721895c499;p=oota-llvm.git 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 --- diff --git a/include/llvm/Use.h b/include/llvm/Use.h index 2759338f42a..e1ebc6a51be 100644 --- a/include/llvm/Use.h +++ b/include/llvm/Use.h @@ -210,30 +210,6 @@ public: unsigned getOperandNo() const; }; - -template<> struct simplify_type > { - typedef User* SimpleType; - - static SimpleType getSimplifiedValue(const value_use_iterator &Val) { - return *Val; - } -}; - -template<> struct simplify_type > - : public simplify_type > {}; - -template<> struct simplify_type > { - typedef const User* SimpleType; - - static SimpleType getSimplifiedValue(const - value_use_iterator &Val) { - return *Val; - } -}; - -template<> struct simplify_type > - : public simplify_type > {}; - } // End llvm namespace #endif