Replies: 1 comment
-
The IncludeDirectiveSyntax nodes are still there if you want to find where exactly files were included; they've just been converted to leading Trivia objects on the Tokens in the parse tree. Also the SourceLocation on each Token points back to the file where the token originated, so you could look it up that way. Alternatively you can call SourceManager::getAllBuffers and then SourceManager::getIncludedFrom on each buffer to see if that buffer came from an include. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How do you easiest get an list of all files included from the top file.
I tried simple using the
SyntaxTree::fromFile()
and then using anSyntaxVisitor
but it seems that there is noIncludeDirectiveSyntax
left in the parsed tree.I could not see an obvious way of getting it from the
SourceManager
either, At least not for me but then my c++ knowledge is mostly from the 90:s so I having a little bit trouble understanding this code.Beta Was this translation helpful? Give feedback.
All reactions