Page MenuHomePhabricator

[MSP430][NFC] Remove redundant condition
Needs ReviewPublic

Authored by baloghadamsoftware on Jun 25 2020, 7:58 AM.

Details

Reviewers
asl
Summary

Condition NumBytes is checked both in an outer and in an inner if statement in MSP430FrameLowering::emitPrologue(). This patch removes the redundant inner check.

The issue was found using clang-tidy check under review misc-redundant-condition. See https://reviews.llvm.org/D81272.

Diff Detail

Event Timeline

asl requested changes to this revision.Jun 25 2020, 12:34 PM
asl added inline comments.
llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
88–89

Please do not add commented-out code. Thanks!

89

Ditto

This revision now requires changes to proceed.Jun 25 2020, 12:34 PM

Removed commented-out lines.

baloghadamsoftware marked 4 inline comments as done.Jun 26 2020, 3:51 AM
baloghadamsoftware added inline comments.
llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
88–89

This was already in the code, I did not change it. Now I removed it.

89

Originally, I commented out this, because of the commented-out line above, because they belong together. Now I removed it too.

asl added inline comments.Jun 26 2020, 5:26 AM
llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
89

Still, there is some commented-out code. And you left obsolete comments which are misleading after removing the code. Will you please remove them while you're there?

baloghadamsoftware marked 2 inline comments as done.

Misleading comment deleted together with the last commented-out line.

baloghadamsoftware marked 2 inline comments as done.Jun 26 2020, 5:46 AM
baloghadamsoftware added inline comments.
llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
89

Sorry, I overlooked that line.

baloghadamsoftware marked an inline comment as done.Jun 30 2020, 7:27 AM

Is it OK now, @asl?