[PATCH] D149445: [MachineInst] Switch NumOperands to 16bits
Dávid Bolvanský via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 2 13:48:40 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG20831c3c2385: [MachineInst] Switch NumOperands to 16bits (authored by xbolva00).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149445/new/
https://reviews.llvm.org/D149445
Files:
llvm/include/llvm/CodeGen/MachineInstr.h
llvm/lib/CodeGen/MachineInstr.cpp
Index: llvm/lib/CodeGen/MachineInstr.cpp
===================================================================
--- llvm/lib/CodeGen/MachineInstr.cpp
+++ llvm/lib/CodeGen/MachineInstr.cpp
@@ -192,6 +192,7 @@
/// an explicit operand it is added at the end of the explicit operand list
/// (before the first implicit operand).
void MachineInstr::addOperand(MachineFunction &MF, const MachineOperand &Op) {
+ assert(NumOperands < USHRT_MAX && "Cannot add more operands.");
assert(MCID && "Cannot add operands before providing an instr descriptor");
// Check if we're adding one of our existing operands.
Index: llvm/include/llvm/CodeGen/MachineInstr.h
===================================================================
--- llvm/include/llvm/CodeGen/MachineInstr.h
+++ llvm/include/llvm/CodeGen/MachineInstr.h
@@ -120,7 +120,7 @@
// Operands are allocated by an ArrayRecycler.
MachineOperand *Operands = nullptr; // Pointer to the first operand.
- unsigned NumOperands = 0; // Number of operands on instruction.
+ uint16_t NumOperands = 0; // Number of operands on instruction.
uint16_t Flags = 0; // Various bits of additional
// information about machine
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149445.518852.patch
Type: text/x-patch
Size: 1263 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230502/51321cf8/attachment.bin>
More information about the llvm-commits
mailing list