[libcxx-commits] [PATCH] D156741: [IR] Deprecate some old methods for getting typed pointer types

Arthur Eubanks via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 11 15:18:15 PDT 2023


aeubanks 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);
----------------
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.


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