[PATCH] D38503: [CodeGen] Unify generation of scalar and struct-path TBAA tags

Ivan A. Kosarev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 3 07:10:44 PDT 2017


kosarev created this revision.
kosarev added a project: clang.

This patch makes it possible to produce access tags in a uniform manner regardless whether the resulting tag will be a scalar or a struct-path one. getAccessTagInfo() now takes care of the actual translation of access descriptors to tags and can handle all kinds of accesses. Facilities that specific to scalar accesses are eliminated.

Some more details:

- DecorateInstructionWithTBAA() is not responsible for conversion of types to access tags anymore. Instead, it takes an access descriptor (TBAAAccessInfo) and generates corresponding access tag from it.
- getTBAAInfoForVTablePtr() reworked to getTBAAVTablePtrAccessInfo() that now returns the virtual-pointer access descriptor and not the virtual-point type metadata.
- Added function getTBAAMayAliasAccessInfo() that returns the descriptor for may-alias accesses.
- getTBAAStructTagInfo() renamed to getTBAAAccessTagInfo() as now it is the only way to generate access tag by a given access descriptor. It is capable of producing both scalar and struct-path tags, depending on options and availability of the base access type. getTBAAScalarTagInfo() and its cache ScalarTagMetadataCache are eliminated.
- Now that we do not need to care about whether the resulting access tag should be a scalar or struct-path one, getTBAAStructTypeInfo() is renamed to getBaseTypeInfo().
- Added function getTBAAAccessInfo() that constructs access descriptor by a given QualType access type.

This is part of https://reviews.llvm.org/D37826 reworked to be a separate patch to simplify review.


Repository:
  rL LLVM

https://reviews.llvm.org/D38503

Files:
  lib/CodeGen/CGAtomic.cpp
  lib/CodeGen/CGClass.cpp
  lib/CodeGen/CGExpr.cpp
  lib/CodeGen/CodeGenModule.cpp
  lib/CodeGen/CodeGenModule.h
  lib/CodeGen/CodeGenTBAA.cpp
  lib/CodeGen/CodeGenTBAA.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38503.117519.patch
Type: text/x-patch
Size: 15315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171003/53a0f208/attachment.bin>


More information about the cfe-commits mailing list