mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Handle scoped imports for Clang submodules.
"import func Darwin.C.math.hypot" will now work to just import "hypot". (Since 'Darwin.C.math' is an implicit submodule of 'Darwin', "import func Darwin.hypot" also works. That's okay.) <rdar://problem/17272311> Swift SVN r20356
This commit is contained in:
@@ -182,7 +182,12 @@ SerializedModuleLoader::validateSerializedAST(StringRef data) {
|
||||
}
|
||||
|
||||
std::string ModuleFile::Dependency::getPrettyPrintedPath() const {
|
||||
std::string output = RawPath.str();
|
||||
StringRef pathWithoutScope = RawPath;
|
||||
if (isScoped()) {
|
||||
size_t splitPoint = pathWithoutScope.find_last_of('\0');
|
||||
pathWithoutScope = pathWithoutScope.slice(0, splitPoint);
|
||||
}
|
||||
std::string output = pathWithoutScope.str();
|
||||
std::replace(output.begin(), output.end(), '\0', '.');
|
||||
return output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user