diff options
author | Jay Foad <jay.foad@amd.com> | 2023-01-13 13:56:47 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2023-01-23 11:31:41 +0000 |
commit | 768aed13785b6a42cc3bcfe829efc231ba536909 (patch) | |
tree | f384bc3bec79d83f9af569f62b6b1bfd78d0ba5c /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | b94b8f1e77d9c41d479108c2e0bc14b09275af40 (diff) | |
download | llvm-768aed13785b6a42cc3bcfe829efc231ba536909.zip llvm-768aed13785b6a42cc3bcfe829efc231ba536909.tar.gz llvm-768aed13785b6a42cc3bcfe829efc231ba536909.tar.bz2 |
[MC] Make more use of MCInstrDesc::operands. NFC.
Change MCInstrDesc::operands to return an ArrayRef so we can easily use
it everywhere instead of the (IMHO ugly) opInfo_begin and opInfo_end.
A future patch will remove opInfo_begin and opInfo_end.
Also use it instead of raw access to the OpInfo pointer. A future patch
will remove this pointer.
Differential Revision: https://reviews.llvm.org/D142213
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index a8fdfa8..27564c8 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -1086,7 +1086,7 @@ int MachineInstr::findFirstPredOperandIdx() const { const MCInstrDesc &MCID = getDesc(); if (MCID.isPredicable()) { for (unsigned i = 0, e = getNumOperands(); i != e; ++i) - if (MCID.OpInfo[i].isPredicate()) + if (MCID.operands()[i].isPredicate()) return i; } @@ -1524,7 +1524,7 @@ LLT MachineInstr::getTypeToPrint(unsigned OpIdx, SmallBitVector &PrintedTypes, if (isVariadic() || OpIdx >= getNumExplicitOperands()) return MRI.getType(Op.getReg()); - auto &OpInfo = getDesc().OpInfo[OpIdx]; + auto &OpInfo = getDesc().operands()[OpIdx]; if (!OpInfo.isGenericType()) return MRI.getType(Op.getReg()); |