diff options
-rw-r--r-- | llvm/include/llvm/IR/InstrTypes.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h index 55f50d43b5f..412eb83b0f9 100644 --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -1224,10 +1224,7 @@ public: /// \brief Return the operand bundle at a specific index. OperandBundleUse getOperandBundle(unsigned Index) const { assert(Index < getNumOperandBundles() && "Index out of bounds!"); - auto *BOI = bundle_op_info_begin() + Index; - auto op_begin = static_cast<const InstrTy *>(this)->op_begin(); - ArrayRef<Use> Inputs(op_begin + BOI->Begin, op_begin + BOI->End); - return OperandBundleUse(BOI->Tag->getKey(), Inputs); + return operandBundleFromBundleOpInfo(*(bundle_op_info_begin() + Index)); } /// \brief Return the number of operand bundles with the tag Name attached to @@ -1320,6 +1317,15 @@ protected: uint32_t End; }; + /// \brief Simple helper function to map a BundleOpInfo to an + /// OperandBundleUse. + OperandBundleUse + operandBundleFromBundleOpInfo(const BundleOpInfo &BOI) const { + auto op_begin = static_cast<const InstrTy *>(this)->op_begin(); + ArrayRef<Use> Inputs(op_begin + BOI.Begin, op_begin + BOI.End); + return OperandBundleUse(BOI.Tag->getKey(), Inputs); + } + typedef BundleOpInfo *bundle_op_iterator; typedef const BundleOpInfo *const_bundle_op_iterator; |