This is an archive of the discontinued LLVM Phabricator instance.

Change while to do-while
ClosedPublic

Authored by pi1024e on Nov 22 2019, 9:52 AM.

Details

Summary

The assert statement says that the location must be a macroID, which is true. However, the while statements checks for that again, which is unnecessary, and gives warnings for returning a potentially non-initialized variable. For this reason, I suggest changing the while to a do-while loop while keeping the assert where it is.

Diff Detail

Event Timeline

pi1024e created this revision.Nov 22 2019, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 22 2019, 9:52 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
pi1024e edited reviewers, added: modocache, sammccall, Quuxplusone; removed: llvm.org.

Missing a test; please upload all patches with full context (-U99999)

pi1024e added a comment.EditedNov 22 2019, 10:43 AM

What do you mean? I test compiled this and there were no errors after running the test benchmark. Was I supposed to do something else?

This is fine as NFC/NFCI patch.

MaskRay accepted this revision.Nov 22 2019, 11:50 AM
This revision is now accepted and ready to land.Nov 22 2019, 11:50 AM

Any updates?

@MaskRay it's been months yet this hasn't landed yet. Why?

@MaskRay it's been months yet this hasn't landed yet. Why?

It is usually assumed that the patch author pushes this commit. In this case, it seems that you don't have commit access. You'll need to provide 'Name <email>' and I can push it for you.

This comment was removed by pi1024e.
This comment was removed by pi1024e.
pi1024e closed this revision.Jun 25 2020, 9:38 AM