[PATCH] D142170: [AVR][NFC] Refactor 'AVRAsmPrinter::PrintAsmOperand'

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 22:35:29 PST 2023


benshi001 added inline comments.


================
Comment at: llvm/lib/Target/AVR/AVRAsmPrinter.cpp:112
+    if (ExtraCode[1] != 0 || ExtraCode[0] < 'A' || ExtraCode[0] > 'Z')
+      return true;
 
----------------
These conditions are checked in https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/AVR/inline-asm/inline-asm-invalid.ll

But I can not compose tests for the following two cases:

1. `ExtraCode[1] != 0`, which will trigger to a fatal error in `llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp`

2. The operand is not a register but `ExtraCode[0]` is not empty. Maybe we treat it as an input error (`return true`) is better than an assert.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142170



More information about the llvm-commits mailing list