I tagged some classes and member variables with my custom attribute, and find them using ASTMatcher. But when I get IDs of them, I found they are changing.
During processing different source files in ASTFrontendAction, a tagged member gets different ID like this:
[debug]Entering file: IntPolygonLineCurve.cpp
[info]Trace var: DeterministicSolution_Mathematics::Fix32::m_RawValue id: 852737
[debug]Entering file: IntPolygonLineCurve.h
[info]Trace var: DeterministicSolution_Mathematics::Fix32::m_RawValue id: 852737
[debug]Entering file: Fix32.cpp
[info]Trace var: DeterministicSolution_Mathematics::Fix32::m_RawValue id: 812389
[debug]Entering file: Fix32.h
[info]Trace var: DeterministicSolution_Mathematics::Fix32::m_RawValue id: 812389
[debug]Entering file: FixSegment.h
[info]Trace var: DeterministicSolution_Mathematics::Fix32::m_RawValue id: 812191
Var name is obtained by getQualifiedNameAsString()
and id is obtained by getID()
But in document, it said getID() will return Unique reproducible object identifier
here
Any thing wrong?