This is an archive of the discontinued LLVM Phabricator instance.

[DenseMapInfo] Move hash_code implementation to Hashing.h
ClosedPublic

Authored by nikic on Oct 8 2021, 11:38 AM.

Details

Summary

This moves the DenseMapInfo implementation for hash_code into Hashing.h, removing the need to include Hashing.h (and thus <string>) in DenseMapInfo.h. This follows the general convention of declaring DenseMapInfo for types that we own in the respective header. The remaining implementations in DenseMapInfo.h are all for types we do not own.

Diff Detail

Event Timeline

nikic created this revision.Oct 8 2021, 11:38 AM
nikic requested review of this revision.Oct 8 2021, 11:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2021, 11:38 AM
lattner accepted this revision.Oct 8 2021, 12:14 PM

nice, makes sense. I'm surprised more #include <string> instances weren't needed in other downstream headers and .cpp files.

This revision is now accepted and ready to land.Oct 8 2021, 12:14 PM
nikic added a comment.Oct 8 2021, 12:21 PM

nice, makes sense. I'm surprised more #include <string> instances weren't needed in other downstream headers and .cpp files.

I landed the necessary (at least for my build) include fixups ahead of time in https://github.com/llvm/llvm-project/commit/cfb53d8e6d6383c9622331224acf0abb03cb1713. Interestingly no <string> includes in particular were needed.

This revision was landed with ongoing or failed builds.Oct 8 2021, 12:44 PM
This revision was automatically updated to reflect the committed changes.

Thanks for looking at this @nikic - are you using https://commondatastorage.googleapis.com/chromium-browser-clang/llvm-include-analysis.html to identify candidate includes or have you been able to get another tool like iwyu to help?