[clang] Use DenseMap::keys (NFC) (#167831)

With DenseMap::keys, we don't need to use [[maybe_unused]].
This commit is contained in:
Kazu Hirata
2025-11-13 07:08:08 -08:00
committed by GitHub
parent bb5f3a08b6
commit 3c85d0412a
2 changed files with 2 additions and 2 deletions

View File

@@ -131,7 +131,7 @@ public:
<< " on StorageLocation " << this << " of type "
<< getType() << "\n";
llvm::dbgs() << "Existing children:\n";
for ([[maybe_unused]] auto [Field, Loc] : Children) {
for (const auto &Field : Children.keys()) {
llvm::dbgs() << Field->getNameAsString() << "\n";
}
}

View File

@@ -81,7 +81,7 @@ bool containsSameFields(const FieldSet &Fields,
const RecordStorageLocation::FieldToLoc &FieldLocs) {
if (Fields.size() != FieldLocs.size())
return false;
for ([[maybe_unused]] auto [Field, Loc] : FieldLocs)
for (const auto &Field : FieldLocs.keys())
if (!Fields.contains(cast_or_null<FieldDecl>(Field)))
return false;
return true;