This is an archive of the discontinued LLVM Phabricator instance.

[CFG] Add iterator_ranges to CFG and CFGBlock.
ClosedPublic

Authored by mboehme on Aug 24 2016, 9:16 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mboehme updated this revision to Diff 69128.Aug 24 2016, 9:16 AM
mboehme updated this revision to Diff 69129.
mboehme retitled this revision from to [CFG] Add iterator_ranges to CFG and CFGBlock..
mboehme updated this object.
mboehme added a reviewer: alexfh.
mboehme added a subscriber: cfe-commits.

Re-add inadvertently deleted blank line

alexfh requested changes to this revision.Aug 24 2016, 10:20 AM
alexfh edited edge metadata.
alexfh added inline comments.
include/clang/Analysis/CFG.h
526 ↗(On Diff #69129)

Most of the time the new functions will be used in a range-based for loop. I don't think the type returned by the functions will need to be explicitly specified anywhere. I'd remove the typedefs.

This revision now requires changes to proceed.Aug 24 2016, 10:20 AM
alexfh accepted this revision.Aug 24 2016, 2:07 PM
alexfh edited edge metadata.

Actually, there's just one comment. Otherwise it's looking good.

This revision is now accepted and ready to land.Aug 24 2016, 2:07 PM
mboehme marked an inline comment as done.Aug 25 2016, 2:12 AM
mboehme added inline comments.
include/clang/Analysis/CFG.h
526 ↗(On Diff #69129)

I agree the typedefs will probably never be used outside this class, but typedefs for iterator_ranges seem to be a common pattern in the Clang codebase. (EnumDecl::enumerator_range and CallExpr::arg_range are two random examples.) I assume the intent is to make the definition of the functions that return these ranges less verbose.

Are you OK with me submitting this patch as-is (with the typedefs)?

alexfh added inline comments.Sep 6 2016, 4:01 AM
include/clang/Analysis/CFG.h
526 ↗(On Diff #69129)

Makes sense.

This revision was automatically updated to reflect the committed changes.
mboehme marked an inline comment as done.