Skip to content
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

Address clang-tidy findings from #4763. #4768

Merged
merged 1 commit into from
Jan 7, 2025
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
6 changes: 3 additions & 3 deletions toolchain/sem_ir/inst_fingerprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ struct Worklist {
}

auto Add(ImportIRId ir_id) -> void {
auto* ir = sem_ir->import_irs().Get(ir_id).sem_ir;
const auto* ir = sem_ir->import_irs().Get(ir_id).sem_ir;
Add(ir->package_id());
Add(ir->library_id());
}
Expand Down Expand Up @@ -267,7 +267,7 @@ struct Worklist {
using Kind = decltype(kind);

// Build a lookup table to add an argument of the given kind.
static constexpr std::array<AddFunction, Kind::NumTypes + 2> table = [] {
static constexpr std::array<AddFunction, Kind::NumTypes + 2> Table = [] {
std::array<AddFunction, Kind::NumTypes + 2> table;
table[Kind::None.ToIndex()] = [](Worklist& /*worklist*/,
uint64_t /*arg*/) {};
Expand All @@ -283,7 +283,7 @@ struct Worklist {
return table;
}();

table[kind.ToIndex()](*this, arg);
Table[kind.ToIndex()](*this, arg);
}

// Ensure all the instructions on the todo list have fingerprints.
Expand Down
2 changes: 1 addition & 1 deletion toolchain/sem_ir/inst_namer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ auto InstNamer::Namespace::AllocateName(

// Append location information to try to disambiguate.
// TODO: Consider handling inst_id cases.
if (LocId* loc_id = std::get_if<LocId>(&loc_id_or_fingerprint)) {
if (auto* loc_id = std::get_if<LocId>(&loc_id_or_fingerprint)) {
if (loc_id->is_node_id()) {
const auto& tree = inst_namer.sem_ir_->parse_tree();
auto token = tree.node_token(loc_id->node_id());
Expand Down
Loading