This is an archive of the discontinued LLVM Phabricator instance.

Draft: [llvm] Replace uses of llvm::Any with std::any
ClosedPublic

Authored by jloser on Aug 13 2022, 9:01 PM.

Details

Reviewers
scott.linder
Summary

llvm::Any is an equivalent version of std::any for use prior to C++17. Now
that a minimum of C++17 standards mode is used for building, use std::any
instead.

The use of llvm::Any in other projects and the eventual removal of llvm::Any are
left for follow-up patches.

Diff Detail

Event Timeline

jloser created this revision.Aug 13 2022, 9:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2022, 9:01 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
jloser requested review of this revision.Aug 13 2022, 9:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2022, 9:01 PM
jloser updated this revision to Diff 452529.Aug 14 2022, 8:50 AM

Fix references to llvm::Any in llvm/IR/PassInstrumentation.h.
Run git clang-format HEAD~1 to fix the clang-format CI step.

jloser updated this revision to Diff 452531.Aug 14 2022, 9:28 AM

Replace uses of llvm::Any in lib/IR/PassTimingInfo.cpp.

jloser updated this revision to Diff 452533.Aug 14 2022, 9:46 AM

Use std::any in llvm/lib/CodeGen/MachinePassManager.cpp.

jloser retitled this revision from [llvm] Replace uses of llvm::Any with std::any to Draft: [llvm] Replace uses of llvm::Any with std::any.Aug 14 2022, 10:25 AM
jloser edited the summary of this revision. (Show Details)
scott.linder accepted this revision.Aug 15 2022, 7:41 AM
This revision is now accepted and ready to land.Aug 15 2022, 7:41 AM

I put up D139532, which includes the work done here and finishes it (also replaces any_cast with std::any_cast, compiles and passes llvm and clang tests).

jloser added a comment.EditedDec 8 2022, 7:18 AM

I put up D139532, which includes the work done here and finishes it (also replaces any_cast with std::any_cast, compiles and passes llvm and clang tests).

Awesome, thanks! Sorry I never got back around to finishing up this idea - was working on other things. I'll close this review and we can revisit yours once the minimum MSVC version is updated to handle the bug mentioned in your revert.

jloser closed this revision.Dec 8 2022, 7:19 AM