[PATCH] D139532: [llvm] Replace llvm::Any with std::any

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 05:27:23 PST 2022


sebastian-ne created this revision.
sebastian-ne added reviewers: scott.linder, jloser, MaskRay, dblaikie.
Herald added subscribers: ormris, StephenFan, wenlei, hiraditya.
Herald added a project: All.
sebastian-ne requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

llvm::Any had several bugs in the past, due to being sensitive to symbol
visibility. (See D101972 <https://reviews.llvm.org/D101972> and D108943 <https://reviews.llvm.org/D108943>)

Even with these fixes applied, I still encounter the same issue on
Windows.

Similar to llvm::Optional going away in favor of std::optional, we can
use std::any from C++17.

Using std::any fixes the problem and puts the burden to do it correctly
on the standard library.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139532

Files:
  llvm/include/llvm/IR/PassInstrumentation.h
  llvm/include/llvm/Passes/StandardInstrumentations.h
  llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
  llvm/lib/CodeGen/MachinePassManager.cpp
  llvm/lib/CodeGen/TargetPassConfig.cpp
  llvm/lib/IR/LLVMContextImpl.h
  llvm/lib/IR/PassTimingInfo.cpp
  llvm/lib/Passes/StandardInstrumentations.cpp
  llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
  llvm/lib/Transforms/Scalar/LoopPassManager.cpp
  llvm/lib/Transforms/Utils/Debugify.cpp
  llvm/tools/llvm-reduce/deltas/RunIRPasses.cpp
  llvm/unittests/IR/PassBuilderCallbacksTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139532.480868.patch
Type: text/x-patch
Size: 53211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/b75b2f1c/attachment.bin>


More information about the llvm-commits mailing list