From 1025f21ef365c49a0f9c68a05507eda28b251b21 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Fri, 23 Jul 2010 08:36:07 +0000 Subject: [PATCH] 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 --- llvm/include/llvm/Use.h | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/llvm/include/llvm/Use.h b/llvm/include/llvm/Use.h index 2759338f42aa..e1ebc6a51be5 100644 --- a/llvm/include/llvm/Use.h +++ b/llvm/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