mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #62185 from xymus/improve-rmodule-loading
Improve `-Rmodule-loading` to show both the path to the source and to the cached file actually loaded
This commit is contained in:
@@ -1965,6 +1965,25 @@ StringRef ModuleDecl::getModuleFilename() const {
|
||||
return Result;
|
||||
}
|
||||
|
||||
StringRef ModuleDecl::getModuleSourceFilename() const {
|
||||
for (auto F : getFiles()) {
|
||||
if (auto *SFU = dyn_cast<SynthesizedFileUnit>(F))
|
||||
continue;
|
||||
return F->getModuleDefiningPath();
|
||||
}
|
||||
|
||||
return StringRef();
|
||||
}
|
||||
|
||||
StringRef ModuleDecl::getModuleLoadedFilename() const {
|
||||
for (auto F : getFiles()) {
|
||||
if (auto LF = dyn_cast<LoadedFile>(F)) {
|
||||
return LF->getLoadedFilename();
|
||||
}
|
||||
}
|
||||
return StringRef();
|
||||
}
|
||||
|
||||
bool ModuleDecl::isStdlibModule() const {
|
||||
return !getParent() && getName() == getASTContext().StdlibModuleName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user