Page MenuHomePhabricator

Add const children() accessors to all AST nodes.
ClosedPublic

Authored by nicolas on Mar 30 2019, 6:25 AM.

Diff Detail

Repository
rC Clang

Event Timeline

nicolas created this revision.Mar 30 2019, 6:25 AM
nicolas changed the repository for this revision from rC Clang to rG LLVM Github Monorepo.Mar 30 2019, 8:25 AM

+1. I wanted to do this but never bothered. Did you go over all the statements on Stmt.h systematically ? You could also do the same thing for all of the statements/expressions in StmtCXX.h, Expr.h, ExprCXX.h, and so on. Apart from this did you run clang-format on the patch ?

Did you go over all the statements on Stmt.h systematically ?

Yes.

You could also do the same thing for all of the statements/expressions in StmtCXX.h, Expr.h, ExprCXX.h, and so on.

I will go over those soon. I believe that Expr.h is mostly done.

Apart from this did you run clang-format on the patch ?

I tried to stick to the style of the non-const functions, even when it was wrong. I will clang-format the next patch!

Did you go over all the statements on Stmt.h systematically ?

Yes.

You could also do the same thing for all of the statements/expressions in StmtCXX.h, Expr.h, ExprCXX.h, and so on.

I will go over those soon. I believe that Expr.h is mostly done.

Apart from this did you run clang-format on the patch ?

I tried to stick to the style of the non-const functions, even when it was wrong. I will clang-format the next patch!

Ah I see. Yeah I know that a fair amount of code is not formatted unfortunately.

nicolas updated this revision to Diff 193288.Apr 2 2019, 7:36 AM
nicolas retitled this revision from Add const children() accessors to Stmts to Add const children() accessors to all AST nodes..
nicolas edited the summary of this revision. (Show Details)

Added children() const to all AST nodes.

nicolas set the repository for this revision to rG LLVM Github Monorepo.
nicolas edited the summary of this revision. (Show Details)

Sorry for the delay. Thanks a lot for the patch!

Some of these casts are rather questionable. However this has nothing to do with your patch since you are just adding the const-qualified version of children(). Therefore I believe this patch looks good. Do you want me to commit it for you ?

riccibruno accepted this revision.Apr 12 2019, 6:23 AM
This revision is now accepted and ready to land.Apr 12 2019, 6:23 AM

Yes, thank you very much!

This revision was automatically updated to reflect the committed changes.