[PATCH] D28554: CodeGen: Add another method to MachineInstrBuilder. NFC
Diana Picus via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 11 04:29:40 PST 2017
rovka created this revision.
rovka added reviewers: MatzeB, kristof.beyls.
rovka added subscribers: llvm-commits, rengolin.
Herald added a subscriber: aemerson.
Add a method that allows adding multiple operands simultaneously to a
MachineInstrBuilder. This is especially useful for operands that are closely
related, such as those representing the predicate on ARM instructions (one
immediate + one register operand).
https://reviews.llvm.org/D28554
Files:
include/llvm/CodeGen/MachineInstrBuilder.h
Index: include/llvm/CodeGen/MachineInstrBuilder.h
===================================================================
--- include/llvm/CodeGen/MachineInstrBuilder.h
+++ include/llvm/CodeGen/MachineInstrBuilder.h
@@ -192,6 +192,13 @@
return *this;
}
+ const MachineInstrBuilder &add(const ArrayRef<MachineOperand> MOs) const {
+ for (const auto &MO : MOs) {
+ MI->addOperand(*MF, MO);
+ }
+ return *this;
+ }
+
const MachineInstrBuilder &addMetadata(const MDNode *MD) const {
MI->addOperand(*MF, MachineOperand::CreateMetadata(MD));
assert((MI->isDebugValue() ? static_cast<bool>(MI->getDebugVariable())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28554.83956.patch
Type: text/x-patch
Size: 642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170111/6bc5d39d/attachment.bin>
More information about the llvm-commits
mailing list