This is an archive of the discontinued LLVM Phabricator instance.

[Support] Don't include <algorithm> in Hashing.h
ClosedPublic

Authored by thakis on Apr 16 2021, 9:05 AM.

Details

Summary

The include is for std::swap(), but that's in <utility> in C++11,
and Hashing.h already includes that.

Diff Detail

Event Timeline

thakis created this revision.Apr 16 2021, 9:05 AM
thakis requested review of this revision.Apr 16 2021, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2021, 9:05 AM
hans accepted this revision.Apr 16 2021, 9:05 AM
This revision is now accepted and ready to land.Apr 16 2021, 9:05 AM
This revision was landed with ongoing or failed builds.Apr 16 2021, 9:06 AM
This revision was automatically updated to reflect the committed changes.

This broke the Windows MLIR buildbot, because algorithm is required for std::min in MSVC.
https://lab.llvm.org/buildbot/#/builders/13/builds/6985/steps/6/logs/stdio

FYI this has caused widespread redness in the bots. The fixes seem to be straightforward so I do not think we need to revert.

FYI this has caused widespread redness in the bots. The fixes seem to be straightforward so I do not think we need to revert.

Actually, I take it back that we do not need to revert. We need to revert because std::rotate in used in Hashing.h.

Thanks for the revert, and sorry about missing this.

(It built fine locally, but that's very c++ standard-lib dependent of course.)

This broke the Windows MLIR buildbot, because algorithm is required for std::min in MSVC.
https://lab.llvm.org/buildbot/#/builders/13/builds/6985/steps/6/logs/stdio

(For this one, the Right Fix would be to add the include in APInt.h , or arguably undo parts of http://reviews.llvm.org/rG405165210b0b2f95e08d84ffcaab534fbd022fde , but since Hashing.h does use std::rotate() it needs to keep the include.)