Skip to content

Remove unused shouldWalkInactiveConfigRegion #76503

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

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions include/swift/IDE/SourceEntityWalker.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ class SourceEntityWalker {
/// This method is called when a Module is referenced in source.
virtual bool visitModuleReference(ModuleEntity Mod, CharSourceRange Range);

/// Whether walk into the inactive region in a #if config statement.
virtual bool shouldWalkInactiveConfigRegion() { return false; }

virtual bool shouldWalkIntoGenericParams() { return true; }

/// Only walk the arguments of a macro, to represent the source as written.
Expand Down
11 changes: 2 additions & 9 deletions lib/IDE/SourceEntityWalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,8 @@ ASTWalker::PreWalkAction SemaAnnotator::walkToDeclPreProper(Decl *D) {
if (Loc.isValid())
NameLen = PrecD->getName().getLength();

} else if (auto *ICD = dyn_cast<IfConfigDecl>(D)) {
if (SEWalker.shouldWalkInactiveConfigRegion()) {
for (auto Clause : ICD->getClauses()) {
for (auto Member : Clause.Elements) {
Member.walk(*this);
}
}
return Action::SkipNode();
}
} else if (isa<IfConfigDecl>(D)) {
// Nothing to do here.
} else if (auto *MD = dyn_cast<MacroExpansionDecl>(D)) {
if (auto *macro =
dyn_cast_or_null<MacroDecl>(MD->getMacroRef().getDecl())) {
Expand Down