Make the User::value_op_iterator a random access iterator. I had written
authorChandler Carruth <chandlerc@gmail.com>
Thu, 17 Apr 2014 09:07:50 +0000 (09:07 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 17 Apr 2014 09:07:50 +0000 (09:07 +0000)
commitc95ce87c237796ffba0d53aa4d9927cb380cd7ce
tree2c95ab46274256862de8ef63f64dd94e750cee1a
parenta30ccb064b8e0d67c26e087b191561ee2e06aac9
Make the User::value_op_iterator a random access iterator. I had written
this code ages ago and lost track of it. Seems worth doing though --
this thing can get called from places that would benefit from knowing
that std::distance is O(1). Also add a very fledgeling unittest for
Users and make sure various aspects of this seem to work reasonably.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206453 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/User.h
unittests/IR/CMakeLists.txt
unittests/IR/UserTest.cpp [new file with mode: 0644]