[PATCH] D125066: [AVR][NFC] Eliminate warning 'unused variable'

Patryk Wychowaniec via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 22:55:08 PDT 2022


Patryk27 added inline comments.


================
Comment at: llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp:1220
 
-  assert(STI.getFrameLowering()->hasReservedCallFrame(MF) &&
-         "unexpected STDSPQRr pseudo instruction");
+  if (!STI.getFrameLowering()->hasReservedCallFrame(MF))
+    assert(0 && "unexpected STDSPQRr pseudo instruction");
----------------
I kinda like `assert(expression && ....);`, since it prints the asserted expression - maybe we can use the void-casting trick we already have for `"pseudo expand limit reached"`?

Say:
```
assert(STI. && ...);
(void)STI;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125066



More information about the llvm-commits mailing list