[PATCH] D122573: [TBAA] Emit distinct TBAA tags for pointers with different depths,types.

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 04:32:37 PDT 2022


fhahn created this revision.
fhahn added reviewers: rjmccall, aaron.ballman, scanon, rsmith, hfinkel.
Herald added subscribers: jeroen.dobbelaere, kosarev.
Herald added a project: All.
fhahn requested review of this revision.
Herald added a project: clang.

This patch extends Clang's TBAA generation code to emit distinct tags
for incompatible pointer types.

Pointers with different element types are incompatible if the pointee
types are also incompatible (modulo sugar/modifiers).

Express this in TBAA by generating different tags for pointers based
on the pointer depth and pointee type. To get the TBAA tag for the
pointee type it uses getTypeInfoHelper on the pointee type.

I'd appreciate a careful review,  because this is probably quite easy to
get subtly wrong.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122573

Files:
  clang/lib/CodeGen/CodeGenTBAA.cpp
  clang/test/CodeGen/tbaa-pointers.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122573.418546.patch
Type: text/x-patch
Size: 10336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220328/8c70f7ff/attachment.bin>


More information about the cfe-commits mailing list