[PATCH] D71849: Don't rely on '%l' modifiers to indicate a label reference

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 13:48:30 PST 2020


void marked an inline comment as done.
void added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:437
         unsigned OpNo = InlineAsm::MIOp_FirstOperand;
+        const auto Operand = MI->getOperand(OpNo);
 
----------------
nickdesaulniers wrote:
> I feel like the check that `OpNo >= MI->getNumOperands()` should probably guard any calls to `MI->getOperand(OpNo)` (or that we should check the output of `MI->getOperand(OpNo)` for validity.  Otherwise, `getOperand` will assert.  This would allow you to hoist the two `OpNo >= MI->getNumOperands()` guards below.
This is one of the reasons why I didn't want to hoist the change out. It's more trouble than it's worth and in the end isn't that useful. I'm changing it back.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71849/new/

https://reviews.llvm.org/D71849





More information about the llvm-commits mailing list