Skip to content

Commit 757c50c

Browse files
authored
[ClangImporter] Align callback with Clang change (#71475)
1 parent 4513005 commit 757c50c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ namespace {
117117
clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
118118
StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
119119
clang::OptionalFileEntryRef File, StringRef SearchPath,
120-
StringRef RelativePath, const clang::Module *Imported,
120+
StringRef RelativePath, const clang::Module *SuggestedModule,
121+
bool ModuleImported,
121122
clang::SrcMgr::CharacteristicKind FileType) override {
122-
handleImport(Imported);
123+
handleImport(ModuleImported ? SuggestedModule : nullptr);
123124
}
124125

125126
void moduleImport(clang::SourceLocation ImportLoc,
@@ -293,18 +294,19 @@ class BridgingPPTracker : public clang::PPCallbacks {
293294
bool IsAngled, clang::CharSourceRange FilenameRange,
294295
clang::OptionalFileEntryRef File,
295296
StringRef SearchPath, StringRef RelativePath,
296-
const clang::Module *Imported,
297+
const clang::Module *SuggestedModule,
298+
bool ModuleImported,
297299
clang::SrcMgr::CharacteristicKind FileType) override {
298-
if (!Imported) {
300+
if (!ModuleImported) {
299301
if (File)
300302
Impl.BridgeHeaderFiles.insert(*File);
301303
return;
302304
}
303305
// Synthesize identifier locations.
304306
SmallVector<clang::SourceLocation, 4> IdLocs;
305-
for (unsigned I = 0, E = getNumModuleIdentifiers(Imported); I != E; ++I)
307+
for (unsigned I = 0, E = getNumModuleIdentifiers(SuggestedModule); I != E; ++I)
306308
IdLocs.push_back(HashLoc);
307-
handleImport(HashLoc, IdLocs, Imported);
309+
handleImport(HashLoc, IdLocs, SuggestedModule);
308310
}
309311

310312
void moduleImport(clang::SourceLocation ImportLoc,

0 commit comments

Comments
 (0)