arphaman added a comment.
I don't think AST manipulation is the right way to do patching. You've already
hit the limitations here in this patch where you can't really remove a
statement unless its parent is a `CompoundStmt`.
I think the right way to do AST patching is to take a 3rd AST(lets cal
johannes created this revision.
Herald added subscribers: mgorny, klimek.
This adds a functions to remove AST nodes.
It works for Decl, and for Stmt nodes that are children of a
CompoundStmt.
Sometimes it is not possible to remove a Decl from its context
despite DeclContext.containsDecl() returni