This is an archive of the discontinued LLVM Phabricator instance.

Improve the C API echo test tool to emit basic block is the right order.
ClosedPublic

Authored by deadalnix on Feb 4 2016, 5:41 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

deadalnix updated this revision to Diff 46985.Feb 4 2016, 5:41 PM
deadalnix retitled this revision from to Improve the C API echo test tool to emit basic block is the right order..
deadalnix updated this object.
deadalnix added a subscriber: llvm-commits.
deadalnix updated this revision to Diff 46986.Feb 4 2016, 5:45 PM

Formating changes + reduce diff size by keeping clone_params at the same place.

deadalnix updated this revision to Diff 47077.Feb 6 2016, 1:22 AM

Remove TODO.

mehdi_amini added inline comments.Feb 9 2016, 11:59 AM
tools/llvm-c-test/echo.cpp
348 ↗(On Diff #47077)

report_fatal_error(..) ?

354 ↗(On Diff #47077)

(same)

368 ↗(On Diff #47077)

This is not clear to me that CloneBB will enforce ordering in the absolute: if "Prev" hasn't been encountered yet it may be seen later and will be moved.

On the opposite if you're relying here on the order in which CloneBB is called, what is the ordering actually doing?

deadalnix added inline comments.Feb 9 2016, 1:32 PM
tools/llvm-c-test/echo.cpp
220 ↗(On Diff #47077)

DeclareBB is called here for instance.

368 ↗(On Diff #47077)

CloneBB will be called in order, but DeclareBB will be called whenever the basic block is needed (for instance, because it is the destination of a branch).

mehdi_amini accepted this revision.Feb 9 2016, 2:04 PM
mehdi_amini edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Feb 9 2016, 2:04 PM
deadalnix updated this revision to Diff 47369.Feb 9 2016, 2:29 PM
deadalnix edited edge metadata.

Use report_fatal_error and remove braces around one line if

This revision was automatically updated to reflect the committed changes.