Hi everyone, I'm new to this forum and clang in general so excuse me in
advance if my question seems dumb !
I'm actually using the clang library to keep track of all the variables via
the ASTMatchers. My goal is to save all the sourceRange of the declarations
and then find the first and last use of each variable and then use a
rewriter at these location to perform some refactoring.
I'm using a Struct containing all the informations about each of these
I use a first ASTMatcher to find all declarations of variables and save
My problem appears when i try to use a second Matcher to find all the
statements of one of these variables and save the first use of this variable
and the last use. I'm able to the and but cannot print the at all.
I think the problem is that i use the SourceManager that is embedded in the
MatchResult object that i get from my second ASTMatcher Query. This result
in something like that :
So is it possible to maintain the sourceManager used in my first matcher and
that would allow me to printToString() the location of the declaration of
these variable ?