Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cxx_indexer): Allow VNames as NodeIds for #5037 #5041

Merged
merged 5 commits into from
Aug 19, 2021

Conversation

zrlk
Copy link
Contributor

@zrlk zrlk commented Aug 18, 2021

This PR allows VNames to be smuggled inside NodeIds. This is necessary
because the alternate semantic metadata rules need to be applied
inside IndexerASTHooks which only deals in NodeIds.

This implementation seemed slightly less evil than encoding a pointer
to a VName in a string. I considered using proto wire format, but
the lifetimes involved make things hard (the indexer likes to deal
in VNameRefs for efficiency (without them IIRC we spent a significant
percentage of cycles on copying strings around) and there's nowhere
for a temporary VName to go).

This PR allows VNames to be smuggled inside NodeIds. This is necessary
because the alternate semantic metadata rules need to be applied
inside IndexerASTHooks which only deals in NodeIds.

This implementation seemed slightly less evil than encoding a pointer
to a VName in a string. I considered using proto wire format, but
the lifetimes involved make things hard (the indexer likes to deal
in VNameRefs for efficiency (without them IIRC we spent a significant
percentage of cycles on copying strings around) and there's nowhere
for a temporary VName to go).
@google-cla google-cla bot added the cla: yes label Aug 18, 2021
@zrlk zrlk requested review from shahms and a team August 18, 2021 22:31
kythe/cxx/indexer/cxx/GraphObserver.cc Outdated Show resolved Hide resolved
@zrlk zrlk merged commit 3040754 into kythe:master Aug 19, 2021
@zrlk zrlk deleted the semameta-vnames branch August 19, 2021 23:32
@jaysachs jaysachs linked an issue Aug 31, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support marking (proto) declarations with semantics
2 participants