Skip to content

Revert "[ClangImporter] Align callback with Clang change (#71475)" #71499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions lib/ClangImporter/ClangImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ namespace {
clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
clang::OptionalFileEntryRef File, StringRef SearchPath,
StringRef RelativePath, const clang::Module *SuggestedModule,
bool ModuleImported,
StringRef RelativePath, const clang::Module *Imported,
clang::SrcMgr::CharacteristicKind FileType) override {
handleImport(ModuleImported ? SuggestedModule : nullptr);
handleImport(Imported);
}

void moduleImport(clang::SourceLocation ImportLoc,
Expand Down Expand Up @@ -294,19 +293,18 @@ class BridgingPPTracker : public clang::PPCallbacks {
bool IsAngled, clang::CharSourceRange FilenameRange,
clang::OptionalFileEntryRef File,
StringRef SearchPath, StringRef RelativePath,
const clang::Module *SuggestedModule,
bool ModuleImported,
const clang::Module *Imported,
clang::SrcMgr::CharacteristicKind FileType) override {
if (!ModuleImported) {
if (!Imported) {
if (File)
Impl.BridgeHeaderFiles.insert(*File);
return;
}
// Synthesize identifier locations.
SmallVector<clang::SourceLocation, 4> IdLocs;
for (unsigned I = 0, E = getNumModuleIdentifiers(SuggestedModule); I != E; ++I)
for (unsigned I = 0, E = getNumModuleIdentifiers(Imported); I != E; ++I)
IdLocs.push_back(HashLoc);
handleImport(HashLoc, IdLocs, SuggestedModule);
handleImport(HashLoc, IdLocs, Imported);
}

void moduleImport(clang::SourceLocation ImportLoc,
Expand Down