[libcxx-commits] [PATCH] D156741: [IR] Deprecate some old methods for getting typed pointer types
Bjorn Pettersson via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Aug 11 15:54:45 PDT 2023
bjope added inline comments.
================
Comment at: llvm/include/llvm/IR/Type.h:491
+ [[deprecated("Pointers no longer have element types")]]
+ inline PointerType *getHalfPtrTy(LLVMContext &C, unsigned AS = 0) {
+ return getInt8PtrTy(C, AS);
----------------
aeubanks wrote:
> bjope wrote:
> > aeubanks wrote:
> > > these are no longer static, that looks unintentional. probably nobody is using these anymore because they're not static, might as well just remove them or make them static again
> > Since all of them are doing the same thing I made these unused versions inline wrappers of getInt8PtrTy (which still is static).
> > And for the "To enforce that no two equal instances are created" part I think the important thing is that PointerType::get is static, or am I missing something?
> >
> > @aeubanks : I'm not sure I understand how it is a problem that they aren't static?
> >
> > (But I'm not sure we need to keep lots of deprecated methods. Not much difference really in getting a Wdeprecated warning or a failed compilation due to a missing function, at least not if building with Werror.)
> >
> >
> It's a non-static member function now, not a static class method. Previously you'd use `PointerType::getFloatPtrTy()`, now you need an instance of a `Type` to call it.
Ah right, ofcourse. Now I got it!
Great catch. But then I think I'll just follow up with at patch that removes these functions (no one has complained so far anyway, and right now it is broken).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156741/new/
https://reviews.llvm.org/D156741
More information about the libcxx-commits
mailing list