This is an archive of the discontinued LLVM Phabricator instance.

Don't check if the result of hasAttrSomewhere is non-zero in CallBase::getReturnedArgOperand()
ClosedPublic

Authored by aeubanks on Sep 6 2021, 12:59 PM.

Details

Summary

Index is 0 when the return value has the returned attribute. But the
return value cannot have the returned attribute, so the check is
pointless.

Diff Detail

Event Timeline

aeubanks created this revision.Sep 6 2021, 12:59 PM
aeubanks requested review of this revision.Sep 6 2021, 12:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2021, 12:59 PM
rnk accepted this revision.Sep 7 2021, 12:02 PM

lgtm

getArgOperand has an assert if you give it an OOB arg index, so this is at least checked.

This revision is now accepted and ready to land.Sep 7 2021, 12:02 PM