[PATCH] D85298: Opaque Pointers: deprecate IRBuilder APIs that inspect pointee type

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 5 06:23:32 PDT 2020


t.p.northover created this revision.
Herald added subscribers: okura, kuter, uenoku, kerbowa, hiraditya, nhaehnle, jvesely, mcrosier.
Herald added a reviewer: uenoku.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.
t.p.northover requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added a subscriber: bbn.

The older APIs for creating load and GEP instructions just inferred the necessary pointee type from the value argument, but when pointers become opaque that's not going to be possible any more so IRBuilder has new calls that take an explicit pointee type.

This marks the older variants as deprecated and updates all places in LLVM & Clang to avoid the resulting warning. In almost all cases I was able to find the element type at the callsite in a future-proof way. The exceptions were AttributorAttributes.cpp and ScalarEvolutionExpander.cpp. They'll need to be fixed at some point but for now I've used `getPointerElementType`.

My main worry here is that it's likely to cause some work for out of tree maintainers to silence the warnings. For now they can mechanically add `Whatever->getType()->getPointerElementType()` if they don't want to do the real work, but it's still nontrivial.


https://reviews.llvm.org/D85298

Files:
  clang/lib/CodeGen/CGAtomic.cpp
  clang/lib/CodeGen/CGBlocks.cpp
  clang/lib/CodeGen/CGBuilder.h
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/CodeGen/CGCUDANV.cpp
  clang/lib/CodeGen/CGCXX.cpp
  clang/lib/CodeGen/CGClass.cpp
  clang/lib/CodeGen/CGDecl.cpp
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CGExprAgg.cpp
  clang/lib/CodeGen/CGExprCXX.cpp
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/lib/CodeGen/CGNonTrivialStruct.cpp
  clang/lib/CodeGen/CGObjC.cpp
  clang/lib/CodeGen/CGObjCGNU.cpp
  clang/lib/CodeGen/CGObjCRuntime.cpp
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
  clang/lib/CodeGen/CGStmtOpenMP.cpp
  clang/lib/CodeGen/CGValue.h
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/lib/CodeGen/ItaniumCXXABI.cpp
  clang/lib/CodeGen/MicrosoftCXXABI.cpp
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGenCXX/inheriting-constructor.cpp
  llvm/include/llvm/IR/IRBuilder.h
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
  llvm/lib/Target/AArch64/AArch64StackTagging.cpp
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/lib/Transforms/Scalar/SROA.cpp
  llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
  llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85298.283212.patch
Type: text/x-patch
Size: 108355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200805/223b1e57/attachment-0001.bin>


More information about the llvm-commits mailing list