[clang][include-tree] Fix spurious dependencies #8264
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch fixes an incorrect assumption that only spurious imports cause both
IncludeTreeBuilder::moduleImport()
andIncludeTreeBuilder::exitedInclude()
to be called for the same directive. This can also happen for#include
of a header that belongs to the module being implemented that previously got transitively loaded from a PCM.Instead of trying to guess that a submodule was a spurious import (by checking that it was not imported, is not from module file but its parent is from module file), we just mark it missing from umbrella header when we detect this. This allows us to stop putting the temporary
ModuleImport
onto the stack in one function and later popping and replacing it bySpuriousImport
in another function.rdar://123253616