This is an archive of the discontinued LLVM Phabricator instance.

[AVR][NFC] Eliminate warning 'unused variable'
ClosedPublic

Authored by benshi001 on May 5 2022, 7:33 PM.

Diff Detail

Event Timeline

benshi001 created this revision.May 5 2022, 7:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2022, 7:33 PM
benshi001 requested review of this revision.May 5 2022, 7:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2022, 7:34 PM

The variable STI is only used in assert, so there will be 'used variable' warnings when doing release build.

Patryk27 added inline comments.May 5 2022, 10:55 PM
llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
1221–1222

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;
benshi001 updated this revision to Diff 427531.May 5 2022, 11:12 PM
benshi001 marked an inline comment as done.
Patryk27 accepted this revision.May 5 2022, 11:13 PM
This revision is now accepted and ready to land.May 5 2022, 11:13 PM
This revision was landed with ongoing or failed builds.May 5 2022, 11:15 PM
This revision was automatically updated to reflect the committed changes.