This is an archive of the discontinued LLVM Phabricator instance.

[AST] Only store the needed data in IfStmt.
ClosedPublic

Authored by riccibruno on Oct 23 2018, 1:27 PM.

Details

Summary

Only store the needed data in IfStmt. This cuts the size of IfStmt
by up to 3 pointers + 1 SourceLocation. The order of the children
is intentionally kept the same even though it would be more
convenient to put the optional trailing objects last.

Diff Detail

Repository
rC Clang

Event Timeline

riccibruno created this revision.Oct 23 2018, 1:27 PM

To add on the issue of changing the order of the children. The more I think about
it the less it seems to be a good idea. Every test passes but I strongly suspect
that a lot of code subtly rely on this.

Yeah, I agree that changing child order is problematic.

riccibruno edited the summary of this revision. (Show Details)

Reworked so that the order of the children is kept the same.

This revision is now accepted and ready to land.Oct 25 2018, 10:31 PM
riccibruno added a reviewer: rsmith.

Add a flag to the output of -ast-dump indicating
which sub-statement IfStmt is storing. This removes
the ambiguity in the output of -ast-dump and addresses
rsmith's comment in D53717.

This revision was automatically updated to reflect the committed changes.