[PATCH] D117885: [OpaquePtrs] Deprecate PointerType::getElementType()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 05:30:49 PST 2022


nikic created this revision.
nikic added a reviewer: opaque-pointers.
Herald added subscribers: dexonsmith, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This deprecates `PointerType::getElementType()` in favor of `Type::getPointerElementType()`. The motivation is to make it more apparent when code accesses the pointer element type, because `getElementType()` may also also refer to at least `ArrayType::getElementType()` and `VectorType::getElementType()`.

Note that this is only a partial change -- if the general idea is agreeable, I'm going to convert uses of `PointerType::getElementType()` first, and then commit the actual deprecation as a separate change lateron. The current revision is just to give a general impression.

Depends on D117870 <https://reviews.llvm.org/D117870>.


https://reviews.llvm.org/D117885

Files:
  llvm/include/llvm/FuzzMutate/OpDescriptor.h
  llvm/include/llvm/IR/DerivedTypes.h
  llvm/include/llvm/IR/Statepoint.h
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
  llvm/lib/FuzzMutate/RandomIRBuilder.cpp
  llvm/lib/IR/AsmWriter.cpp
  llvm/lib/IR/AutoUpgrade.cpp
  llvm/lib/IR/Core.cpp
  llvm/lib/IR/Function.cpp
  llvm/lib/IR/IRBuilder.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/lib/Transforms/Coroutines/CoroFrame.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
  llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
  llvm/lib/Transforms/Scalar/SROA.cpp
  llvm/lib/Transforms/Scalar/Scalarizer.cpp
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117885.401962.patch
Type: text/x-patch
Size: 31334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220121/7df078c6/attachment.bin>


More information about the llvm-commits mailing list