Skip to content

Commit

Permalink
Address clang-tidy findings from #4763. (#4768)
Browse files Browse the repository at this point in the history
  • Loading branch information
zygoloid authored Jan 7, 2025
1 parent 1d379ff commit 13c121c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 13c121c

Please sign in to comment.