[llvm] 94db1e9 - Revert "[IR] Remove arg_operands and getNumArgOperands (NFC)"

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 08:40:50 PDT 2021


Author: Kazu Hirata
Date: 2021-10-06T08:40:39-07:00
New Revision: 94db1e98a6c072fdc4585f7dbe986604a7d28b35

URL: https://github.com/llvm/llvm-project/commit/94db1e98a6c072fdc4585f7dbe986604a7d28b35
DIFF: https://github.com/llvm/llvm-project/commit/94db1e98a6c072fdc4585f7dbe986604a7d28b35.diff

LOG: Revert "[IR] Remove arg_operands and getNumArgOperands (NFC)"

This reverts commit c72722f45ef1aa6d78e1e6fee07ab6bd86980da8.

Added: 
    

Modified: 
    llvm/include/llvm/IR/InstrTypes.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index a2180a8d4b2a..4546e80fc87a 100644
--- a/llvm/include/llvm/IR/InstrTypes.h
+++ b/llvm/include/llvm/IR/InstrTypes.h
@@ -1325,6 +1325,16 @@ class CallBase : public Instruction {
   bool arg_empty() const { return arg_end() == arg_begin(); }
   unsigned arg_size() const { return arg_end() - arg_begin(); }
 
+  // Legacy API names that duplicate the above and will be removed once users
+  // are migrated.
+  iterator_range<User::op_iterator> arg_operands() {
+    return make_range(arg_begin(), arg_end());
+  }
+  iterator_range<User::const_op_iterator> arg_operands() const {
+    return make_range(arg_begin(), arg_end());
+  }
+  unsigned getNumArgOperands() const { return arg_size(); }
+
   Value *getArgOperand(unsigned i) const {
     assert(i < arg_size() && "Out of bounds!");
     return getOperand(i);


        


More information about the llvm-commits mailing list