@@ -328,7 +328,7 @@ class BridgingPPTracker : public clang::PPCallbacks {
328
328
return ;
329
329
SmallVector<clang::SourceLocation, 4 > IdLocs;
330
330
for (auto &P : Path)
331
- IdLocs.push_back (P.second );
331
+ IdLocs.push_back (P.getLoc () );
332
332
handleImport (ImportLoc, IdLocs, Imported);
333
333
}
334
334
@@ -2291,17 +2291,15 @@ ModuleDecl *ClangImporter::Implementation::loadModuleClang(
2291
2291
auto realModuleName = SwiftContext.getRealModuleName (path.front ().Item ).str ();
2292
2292
2293
2293
// Convert the Swift import path over to a Clang import path.
2294
- SmallVector<std::pair<clang::IdentifierInfo *, clang::SourceLocation>, 4 >
2295
- clangPath;
2294
+ SmallVector<clang::IdentifierLoc, 4 > clangPath;
2296
2295
bool isTopModuleComponent = true ;
2297
2296
for (auto component : path) {
2298
2297
StringRef item = isTopModuleComponent? realModuleName:
2299
2298
component.Item .str ();
2300
2299
isTopModuleComponent = false ;
2301
2300
2302
- clangPath.emplace_back (
2303
- getClangPreprocessor ().getIdentifierInfo (item),
2304
- exportSourceLoc (component.Loc ));
2301
+ clangPath.emplace_back (exportSourceLoc (component.Loc ),
2302
+ getClangPreprocessor ().getIdentifierInfo (item));
2305
2303
}
2306
2304
2307
2305
auto &diagEngine = Instance->getDiagnostics ();
@@ -2311,14 +2309,13 @@ ModuleDecl *ClangImporter::Implementation::loadModuleClang(
2311
2309
auto loadModule = [&](clang::ModuleIdPath path,
2312
2310
clang::Module::NameVisibilityKind visibility)
2313
2311
-> clang::ModuleLoadResult {
2314
- auto importRAII =
2315
- diagClient.handleImport (clangPath.front ().first , diagEngine,
2316
- importLoc);
2312
+ auto importRAII = diagClient.handleImport (
2313
+ clangPath.front ().getIdentifierInfo (), diagEngine, importLoc);
2317
2314
2318
2315
std::string preservedIndexStorePathOption;
2319
2316
auto &clangFEOpts = Instance->getFrontendOpts ();
2320
2317
if (!clangFEOpts.IndexStorePath .empty ()) {
2321
- StringRef moduleName = path[0 ].first ->getName ();
2318
+ StringRef moduleName = path[0 ].getIdentifierInfo () ->getName ();
2322
2319
// Ignore the SwiftShims module for the index data.
2323
2320
if (moduleName == SwiftContext.SwiftShimsModuleName .str ()) {
2324
2321
preservedIndexStorePathOption = clangFEOpts.IndexStorePath ;
0 commit comments