This is an archive of the discontinued LLVM Phabricator instance.

CodeGenPrep: rewrite a few loops in C++11 style
ClosedPublic

Authored by artagnon on Jan 7 2015, 11:20 AM.

Details

Summary

I wanted to add some code to CodeGenPrep, but I thought I should get
these nits out of the way first.

Diff Detail

Event Timeline

artagnon updated this revision to Diff 17867.Jan 7 2015, 11:20 AM
artagnon retitled this revision from to CodeGenPrep: rewrite a few loops in C++11 style.
artagnon updated this object.
artagnon edited the test plan for this revision. (Show Details)
artagnon added reviewers: qcolombet, craig.topper.
artagnon added a subscriber: Unknown Object (MLST).
qcolombet accepted this revision.Jan 7 2015, 11:24 AM
qcolombet edited edge metadata.

Hi Ramkumar,

Go ahead with those clean-ups.
If you happen to want to do some other clean-ups, just commit, no need to review :).

Thanks,
-Quentin

This revision is now accepted and ready to land.Jan 7 2015, 11:24 AM

Hi Craig,

I don't have commit access; could you do it for me?

Thanks,
Ram

silvas added a subscriber: silvas.Jan 7 2015, 2:28 PM

Doesn't iterating over function give BB's? I.e. shouldn't this be for (BasicBlock &BB : F)?

It depends on what you want to construct from the iteration. You could construct a BasicBlock, like you said; but this is perfectly valid too: you can try it out, and see that tests pass.

artagnon updated this revision to Diff 17876.Jan 7 2015, 3:27 PM
artagnon edited edge metadata.

Revert first hunk, and change the cursor to BasicBlock in the second
and third loops. Do one additional inner loop.

artagnon removed a subscriber: silvas.
artagnon updated this revision to Diff 17878.Jan 7 2015, 3:57 PM

Revert last hunk. Thanks to Duncan.

dexonsmith edited edge metadata.Jan 8 2015, 11:33 AM

LGTM (with a nit). Let me know if you need me to commit it for you.

artagnon updated this revision to Diff 17907.Jan 8 2015, 12:29 PM
artagnon edited edge metadata.

Fix nit pointed out by Duncan: BasicBlock* -> BasicBlock *.

(Once you have an LGTM, there's no need to repost a review, just
fix it offline and commit.)

Do you need someone to commit this for you?

Yes, please commit for me if this is okay.

artagnon closed this revision.Jan 8 2015, 1:58 PM