Fix problem with r204836
authorEli Bendersky <eliben@google.com>
Wed, 26 Mar 2014 20:41:15 +0000 (20:41 +0000)
committerEli Bendersky <eliben@google.com>
Wed, 26 Mar 2014 20:41:15 +0000 (20:41 +0000)
commit1003e8fbfa2f436e88ef801cf4c3d33fc978e565
tree8a5f80dab085cbee80917d8c9501063f24697e3a
parent6da017873777cbe06bf2d5606e408c7cda85062e
Fix problem with r204836

In CallInst, op_end() points at the callee, which we don't want to iterate over
when just iterating over arguments. Now take this into account when returning
a iterator_range from arg_operands. Similar reasoning for InvokeInst.

Also adds a unit test to verify this actually works as expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204851 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Instructions.h
unittests/IR/InstructionsTest.cpp