summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-11-04 04:31:21 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-11-04 04:31:21 +0000
commitbf9d76d62e85a43ea389ce244f69416dc4a67079 (patch)
treeef5bf1dc84cdf6f499997d7eec63c87a0387f489 /llvm
parent3c95d5d28ec2b006da2df9e0669d41aba56b4451 (diff)
downloadbcm5719-llvm-bf9d76d62e85a43ea389ce244f69416dc4a67079.tar.gz
bcm5719-llvm-bf9d76d62e85a43ea389ce244f69416dc4a67079.zip
[OperandBundles] Refactor; NFCI.
Extract out a helper function `operandBundleFromBundleOpInfo`. llvm-svn: 252038
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/IR/InstrTypes.h14
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;
OpenPOWER on IntegriCloud