I have an AST that I created by analyzing the source code using the Clang library. I would like to clone AST so that I can parse other code that might be invalid. If it is invalid, I will return to my clone to parse additional fragments of the source code. I do not want to parse the same source code twice for performance reasons.
The Clang AST view is very rich, and some nodes contain pointers to other nodes.
Does Clang provide an AST cloning utility that handles this complexity?
source
share