This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Replace STLForwardCompat.h's C++17 equivalents
ClosedPublic

Authored by jloser on Aug 11 2022, 1:43 PM.

Details

Summary

STLForwardCompat.h defines several utilities and type traits to mimic that of
the ones in the C++17 standard library. Now that LLVM is built with the C++17
standards mode, remove these equivalents in favor of the ones from the
standard library.

Diff Detail

Event Timeline

jloser created this revision.Aug 11 2022, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2022, 1:43 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
jloser requested review of this revision.Aug 11 2022, 1:43 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 11 2022, 1:43 PM
MaskRay accepted this revision.Aug 11 2022, 1:52 PM

The llvm/include/llvm/ADT/STLForwardCompat.h and llvm/unittests/ADT/STLForwardCompatTest.cpp removal can be in a separate patch.

This revision is now accepted and ready to land.Aug 11 2022, 1:52 PM
jloser updated this revision to Diff 451977.Aug 11 2022, 2:03 PM

Revert removal of these utilities and type traits from STLForwardCompat.h and their corresponding unit tests. The removal of these will be done in a separate patch.

The llvm/include/llvm/ADT/STLForwardCompat.h and llvm/unittests/ADT/STLForwardCompatTest.cpp removal can be in a separate patch.

Sure. I just split them out of this patch and I'll do the removal in a follow-up patch.

scott.linder accepted this revision.Aug 11 2022, 3:56 PM

LGTM, thank you!

I have some pending changes which would add C++20 "compat" types, but removing it until those land sounds fine to me.

jloser updated this revision to Diff 452022.Aug 11 2022, 4:01 PM

Fix unqualified use of in_place so the delegating constructor in Optional calls the one taking the std::in_place_t tag.