Open jirislaby opened 1 month ago
For simple structures like this:
struct A { struct { int a; }; struct { int b; }; };
generateUSRForDecl at: https://github.com/llvm/llvm-project/blob/6009708b4367171ccdbf4b5905cb6a803753fe18/clang/lib/Index/USRGeneration.cpp#L1141 returns false for the two struct A's fields, i.e. the anonymous structures. And their USR is indeed duplicate c:@S@A@FI@.
generateUSRForDecl
false
struct A
c:@S@A@FI@
BTW USR of those ints a and b is indeed valid and correct. c:@S@A@Sa@FI@a and c:@S@A@Sa@FI@b , respectively.
int
a
b
c:@S@A@Sa@FI@a
c:@S@A@Sa@FI@b
Why not simply add a field index after their @FI@?
@FI@
6f536f2 seems to work, but I am not sure it's optimal.
For simple structures like this:
generateUSRForDecl
at: https://github.com/llvm/llvm-project/blob/6009708b4367171ccdbf4b5905cb6a803753fe18/clang/lib/Index/USRGeneration.cpp#L1141 returnsfalse
for the twostruct A
's fields, i.e. the anonymous structures. And their USR is indeed duplicatec:@S@A@FI@
.BTW USR of those
int
sa
andb
is indeed valid and correct.c:@S@A@Sa@FI@a
andc:@S@A@Sa@FI@b
, respectively.Why not simply add a field index after their
@FI@
?