@@ -1573,11 +1573,10 @@ bool ClangImporter::canImportModule(std::pair<Identifier, SourceLoc> moduleID) {
1573
1573
return clangModule->isAvailable (ctx.getLangOpts (), getTargetInfo (), r, mh, m);
1574
1574
}
1575
1575
1576
- ModuleDecl *ClangImporter::loadModuleClang (
1577
- SourceLoc importLoc,
1578
- ArrayRef<std::pair<Identifier, SourceLoc>> path) {
1579
- auto &clangContext = Impl.getClangASTContext ();
1580
- auto &clangHeaderSearch = Impl.getClangPreprocessor ().getHeaderSearchInfo ();
1576
+ ModuleDecl *ClangImporter::Implementation::loadModuleClang (
1577
+ SourceLoc importLoc, ArrayRef<std::pair<Identifier, SourceLoc>> path) {
1578
+ auto &clangContext = getClangASTContext ();
1579
+ auto &clangHeaderSearch = getClangPreprocessor ().getHeaderSearchInfo ();
1581
1580
1582
1581
// Look up the top-level module first, to see if it exists at all.
1583
1582
clang::Module *clangModule = clangHeaderSearch.lookupModule (
@@ -1588,47 +1587,47 @@ ModuleDecl *ClangImporter::loadModuleClang(
1588
1587
1589
1588
// Convert the Swift import path over to a Clang import path.
1590
1589
SmallVector<std::pair<clang::IdentifierInfo *, clang::SourceLocation>, 4 >
1591
- clangPath;
1590
+ clangPath;
1592
1591
for (auto component : path) {
1593
- clangPath.push_back ({ &clangContext.Idents .get (component.first .str ()),
1594
- Impl. exportSourceLoc (component.second ) } );
1592
+ clangPath.push_back ({&clangContext.Idents .get (component.first .str ()),
1593
+ exportSourceLoc (component.second )} );
1595
1594
}
1596
1595
1597
- auto &rawDiagClient = Impl. Instance ->getDiagnosticClient ();
1596
+ auto &rawDiagClient = Instance->getDiagnosticClient ();
1598
1597
auto &diagClient = static_cast <ClangDiagnosticConsumer &>(rawDiagClient);
1599
1598
1600
1599
auto loadModule = [&](clang::ModuleIdPath path,
1601
1600
bool makeVisible) -> clang::ModuleLoadResult {
1602
1601
clang::Module::NameVisibilityKind visibility =
1603
- makeVisible ? clang::Module::AllVisible : clang::Module::Hidden;
1602
+ makeVisible ? clang::Module::AllVisible : clang::Module::Hidden;
1604
1603
1605
- auto importRAII = diagClient. handleImport (clangPath. front (). first ,
1606
- importLoc);
1604
+ auto importRAII =
1605
+ diagClient. handleImport (clangPath. front (). first , importLoc);
1607
1606
1608
1607
std::string preservedIndexStorePathOption;
1609
- auto &clangFEOpts = Impl. Instance ->getFrontendOpts ();
1608
+ auto &clangFEOpts = Instance->getFrontendOpts ();
1610
1609
if (!clangFEOpts.IndexStorePath .empty ()) {
1611
1610
StringRef moduleName = path[0 ].first ->getName ();
1612
1611
// Ignore the SwiftShims module for the index data.
1613
- if (moduleName == Impl. SwiftContext .SwiftShimsModuleName .str ()) {
1612
+ if (moduleName == SwiftContext.SwiftShimsModuleName .str ()) {
1614
1613
preservedIndexStorePathOption = clangFEOpts.IndexStorePath ;
1615
1614
clangFEOpts.IndexStorePath .clear ();
1616
1615
}
1617
1616
}
1618
1617
1619
- clang::SourceLocation clangImportLoc = Impl. getNextIncludeLoc ();
1618
+ clang::SourceLocation clangImportLoc = getNextIncludeLoc ();
1620
1619
1621
1620
clang::ModuleLoadResult result =
1622
- Impl. Instance ->loadModule (clangImportLoc, path, visibility,
1623
- /* IsInclusionDirective=*/ false );
1621
+ Instance->loadModule (clangImportLoc, path, visibility,
1622
+ /* IsInclusionDirective=*/ false );
1624
1623
1625
1624
if (!preservedIndexStorePathOption.empty ()) {
1626
1625
// Restore the -index-store-path option.
1627
1626
clangFEOpts.IndexStorePath = preservedIndexStorePathOption;
1628
1627
}
1629
1628
1630
1629
if (result && makeVisible)
1631
- Impl. getClangPreprocessor ().makeModuleVisible (result, clangImportLoc);
1630
+ getClangPreprocessor ().makeModuleVisible (result, clangImportLoc);
1632
1631
return result;
1633
1632
};
1634
1633
@@ -1663,13 +1662,13 @@ ModuleDecl *ClangImporter::loadModuleClang(
1663
1662
if (!clangModule)
1664
1663
return nullptr ;
1665
1664
1666
- return Impl. finishLoadingClangModule (clangModule, /* preferOverlay=*/ false );
1665
+ return finishLoadingClangModule (clangModule, /* preferOverlay=*/ false );
1667
1666
}
1668
1667
1669
1668
ModuleDecl *ClangImporter::loadModule (
1670
1669
SourceLoc importLoc,
1671
1670
ArrayRef<std::pair<Identifier, SourceLoc>> path) {
1672
- ModuleDecl *MD = loadModuleClang (importLoc, path);
1671
+ ModuleDecl *MD = Impl. loadModuleClang (importLoc, path);
1673
1672
if (!MD)
1674
1673
MD = Impl.loadModuleDWARF (importLoc, path);
1675
1674
return MD;
0 commit comments