[llvm] [BOLT] Support non-null MCInst operands in annotation handling (PR #192188)

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 22:53:24 PDT 2026


================
@@ -117,8 +117,14 @@ template <typename ValueType> class MCSimpleAnnotation : public MCAnnotation {
 /// annotations.
 inline unsigned getNumPrimeOperands(const MCInst &Inst) {
   for (signed I = Inst.getNumOperands() - 1; I >= 0; --I) {
-    if (Inst.getOperand(I).isInst())
-      return I;
+    if (Inst.getOperand(I).isInst()) {
----------------
aaupov wrote:

Define a helper and use it in both places?

https://github.com/llvm/llvm-project/pull/192188


More information about the llvm-commits mailing list