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

Support C++ modules #5543

Open
zrlk opened this issue Mar 21, 2023 · 0 comments
Open

Support C++ modules #5543

zrlk opened this issue Mar 21, 2023 · 0 comments
Assignees
Labels
C++ Issues affecting C++

Comments

@zrlk
Copy link
Contributor

zrlk commented Mar 21, 2023

Support implicit and explicit C++ modules in extraction and indexing.

@zrlk zrlk added the C++ Issues affecting C++ label Mar 21, 2023
@zrlk zrlk self-assigned this Mar 21, 2023
zrlk added a commit to zrlk/kythe that referenced this issue Mar 28, 2023
In service of kythe#5543.

This PR should only affect the behavior of the extractor
where it would have either crashed because of a null
dereference or due to a CHECK-fail. The conditions
leading to these cases occur when modules are turned on.
zrlk added a commit to zrlk/kythe that referenced this issue Apr 5, 2023
In service of kythe#5543.

This PR should only affect the behavior of the extractor
where it would have either crashed because of a null
dereference or due to a CHECK-fail. The conditions
leading to these cases occur when modules are turned on.
zrlk added a commit that referenced this issue Apr 5, 2023
* fix(cxx_extractor): don't crash when modules are on

In service of #5543.

This PR should only affect the behavior of the extractor
where it would have either crashed because of a null
dereference or due to a CHECK-fail. The conditions
leading to these cases occur when modules are turned on.

* fix: address comments

* fix: add a test case

* fix: address comments
zrlk added a commit to zrlk/kythe that referenced this issue Apr 12, 2023
The extractor will refuse to load pch/modules if they are
built from a different libclang than the extractor binary.
This is not ideal. Of course, there may be breaking changes
in the pch format, but it's not unreasonable to assume that
these changes happen less than daily. (Initial impressions
hold that we still need to get around this problem to read
even simple file content from a pch.)

This PR disables pch validation. Since we don't officially
support builds that require pch/modules yet, the danger here
is that we crash on a bad or incompatible (or actually corrupt)
pch instead of quitting nicely with a diagnostic.

In service of kythe#5543.
zrlk added a commit to zrlk/kythe that referenced this issue Apr 13, 2023
It's kythe#5571 for the indexer. In production, the extractor and
indexer are unlikely to have been built with the same libclang.

In service of kythe#5543.
zrlk added a commit that referenced this issue Apr 14, 2023
* fix(cxx_extractor): don't validate pchs

The extractor will refuse to load pch/modules if they are
built from a different libclang than the extractor binary.
This is not ideal. Of course, there may be breaking changes
in the pch format, but it's not unreasonable to assume that
these changes happen less than daily. (Initial impressions
hold that we still need to get around this problem to read
even simple file content from a pch.)

This PR disables pch validation. Since we don't officially
support builds that require pch/modules yet, the danger here
is that we crash on a bad or incompatible (or actually corrupt)
pch instead of quitting nicely with a diagnostic.

In service of #5543.

* fix: include PreprocessorOptions.h
zrlk added a commit that referenced this issue Apr 14, 2023
It's #5571 for the indexer. In production, the extractor and
indexer are unlikely to have been built with the same libclang.

In service of #5543.
zrlk added a commit to zrlk/kythe that referenced this issue May 1, 2023
Files loaded from pch/pcms don't trigger the same preprocessor
callbacks as files encountered through normal includes. This
causes us to assign them the default claim token/default file
vname, which in turn breaks references from dependent modules.
This PR ascribes vnames to pch/pcm-sourced files in the
standard way.

It may be possible to preload claim tokens for pch/pcm files.
This is left to a future PR.

In service of kythe#5543
zrlk added a commit that referenced this issue May 1, 2023
Files loaded from pch/pcms don't trigger the same preprocessor
callbacks as files encountered through normal includes. This
causes us to assign them the default claim token/default file
vname, which in turn breaks references from dependent modules.
This PR ascribes vnames to pch/pcm-sourced files in the
standard way.

It may be possible to preload claim tokens for pch/pcm files.
This is left to a future PR.

In service of #5543
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ Issues affecting C++
Projects
None yet
Development

No branches or pull requests

1 participant