This is an archive of the discontinued LLVM Phabricator instance.

[RegisterCoalescer] fix potential use of undef value. NFC
ClosedPublic

Authored by nickdesaulniers on May 19 2019, 3:51 PM.

Details

Summary

Fixes a warning produced from scan-build (llvm.org/reports/scan-build/),
further warnings found by annotation isMoveInstr [[nodiscard]].

isMoveInstr potentially does not assign to its parameters, so if they
were uninitialized, they will potentially stay uninitialized. It seems
most call sites pass references to uninitialized values, then use them
without checking the return value.

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2019, 3:51 PM

Looks like I can/should use LLVM_NODISCARD.

  • use LLVM_NODISCARD
wmi accepted this revision.May 22 2019, 9:53 AM

LGTM. Thanks for fixing that.

This revision is now accepted and ready to land.May 22 2019, 9:53 AM
This revision was automatically updated to reflect the committed changes.