Skip to content

[Dependency Scannning] Handle special case import of Clang Private "submodules" #66148

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

Merged
merged 1 commit into from
May 26, 2023

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented May 25, 2023

There is a special case that already exists in ClangImporter for implicit module loading: Import of a "submodule" named Foo.Private is treated as a top-level module named Foo_Private. Clang has special support for this.

Resolves rdar://108287140

…ubmodules"

There is a special case that already exists in 'ClangImporter' for implicit module loading:
Import of a "submodule" named "Foo.Private" is treated as a top-level module named "Foo_Private".
Clang has special support for this.

Resolves rdar://108287140
@artemcm
Copy link
Contributor Author

artemcm commented May 25, 2023

@swift-ci smoke test

@@ -543,7 +543,18 @@ class ModuleDependencyInfo {
/// Add a dependency on the given module, if it was not already in the set.
void addModuleImport(ImportPath::Module module,
llvm::StringSet<> *alreadyAddedModules = nullptr) {
addModuleImport(module.front().Item.str(), alreadyAddedModules);
std::string ImportedModuleName = module.front().Item.str().str();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the .str().str() intentional?

Copy link
Contributor Author

@artemcm artemcm May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, yes. Not enough to have a StringRef now that we may be changing the value of this.

@artemcm
Copy link
Contributor Author

artemcm commented May 25, 2023

@swift-ci smoke test

@artemcm
Copy link
Contributor Author

artemcm commented May 26, 2023

@swift-ci smoke test

@artemcm artemcm merged commit bc5e8ba into swiftlang:main May 26, 2023
@artemcm artemcm deleted the PrivateClangSubmoduleScan branch May 26, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants