Skip to content

Commit

Permalink
Remove extra SemIR:: qualification in NameScope since it's alread…
Browse files Browse the repository at this point in the history
…y in `SemIR` namespace (#4823)
  • Loading branch information
bricknerb authored Jan 20, 2025
1 parent 30c1530 commit d30957f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion toolchain/sem_ir/name_scope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ auto NameScope::AddRequired(Entry name_entry) -> void {
}
}

auto NameScope::LookupOrAdd(SemIR::NameId name_id, InstId inst_id,
auto NameScope::LookupOrAdd(NameId name_id, InstId inst_id,
AccessKind access_kind)
-> std::pair<bool, EntryId> {
auto insert_result = name_map_.Insert(name_id, EntryId(names_.size()));
Expand Down
16 changes: 7 additions & 9 deletions toolchain/sem_ir/name_scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class NameScope : public Printable<NameScope> {
// using inst_id and access_kind and returns false with the new EntryId.
//
// This cannot be used to add poisoned entries; use LookupOrPoison instead.
auto LookupOrAdd(SemIR::NameId name_id, InstId inst_id,
AccessKind access_kind) -> std::pair<bool, EntryId>;
auto LookupOrAdd(NameId name_id, InstId inst_id, AccessKind access_kind)
-> std::pair<bool, EntryId>;

// Searches for the given name. If found, including if a poisoned entry is
// found, returns the corresponding EntryId. Otherwise, returns nullopt and
Expand All @@ -83,7 +83,7 @@ class NameScope : public Printable<NameScope> {
return extended_scopes_;
}

auto AddExtendedScope(SemIR::InstId extended_scope) -> void {
auto AddExtendedScope(InstId extended_scope) -> void {
extended_scopes_.push_back(extended_scope);
}

Expand Down Expand Up @@ -111,13 +111,12 @@ class NameScope : public Printable<NameScope> {
}

auto import_ir_scopes() const
-> llvm::ArrayRef<std::pair<SemIR::ImportIRId, SemIR::NameScopeId>> {
-> llvm::ArrayRef<std::pair<ImportIRId, NameScopeId>> {
return import_ir_scopes_;
}

auto AddImportIRScope(
const std::pair<SemIR::ImportIRId, SemIR::NameScopeId>& import_ir_scope)
-> void {
const std::pair<ImportIRId, NameScopeId>& import_ir_scope) -> void {
import_ir_scopes_.push_back(import_ir_scope);
}

Expand Down Expand Up @@ -168,8 +167,7 @@ class NameScope : public Printable<NameScope> {

// Imported IR scopes that compose this namespace. This will be empty for
// scopes that correspond to the current package.
llvm::SmallVector<std::pair<SemIR::ImportIRId, SemIR::NameScopeId>, 0>
import_ir_scopes_;
llvm::SmallVector<std::pair<ImportIRId, NameScopeId>, 0> import_ir_scopes_;
};

// Provides a ValueStore wrapper for an API specific to name scopes.
Expand Down Expand Up @@ -211,7 +209,7 @@ class NameScopeStore {
return false;
}
// A package is either the current package or an imported package.
return scope_id == SemIR::NameScopeId::Package ||
return scope_id == NameScopeId::Package ||
Get(scope_id).is_imported_package();
}

Expand Down

0 comments on commit d30957f

Please sign in to comment.