[llvm] [RISCV][NFC] Use maybe_unused instead of casting to void to fix unused variable warning. (PR #80651)

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 03:22:31 PST 2024


https://github.com/asb approved this pull request.

Although the sample code in CodingStandards for silencing a warning from an unused var (which uses a cast) hasn't been updated, I see plenty of `[[maybe_unused]]` usage in the LLVM codebase and there seemed support for using it more broadly in a [thread that died out](https://discourse.llvm.org/t/maybe-unused-vs-attribute-unused-vs-void-var-for-assert-variables/64212). In the context of the RISC-V  backend, this seems like a reasonable clean-up to me and it's small in scope. LGTM.

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


More information about the llvm-commits mailing list