diff options
author | Ivan A. Kosarev <ikosarev@accesssoftek.com> | 2017-10-31 11:05:34 +0000 |
---|---|---|
committer | Ivan A. Kosarev <ikosarev@accesssoftek.com> | 2017-10-31 11:05:34 +0000 |
commit | b9c59f36fc2ae7008801c2c2966db7e3a8427251 (patch) | |
tree | f223281598aa8f9f7b3c637ba99910fe47e2fdef /clang/lib/CodeGen/CodeGenModule.h | |
parent | 7263f1bda695772732c5a8ddbed2d07713a7e59c (diff) | |
download | bcm5719-llvm-b9c59f36fc2ae7008801c2c2966db7e3a8427251.tar.gz bcm5719-llvm-b9c59f36fc2ae7008801c2c2966db7e3a8427251.zip |
[CodeGen] Propagate may-alias'ness of lvalues with TBAA info
This patch fixes various places in clang to propagate may-alias
TBAA access descriptors during construction of lvalues, thus
eliminating the need for the LValueBaseInfo::MayAlias flag.
This is part of D38126 reworked to be a separate patch to
simplify review.
Differential Revision: https://reviews.llvm.org/D39008
llvm-svn: 316988
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index ebc1ec65cfe..21bab6cfa05 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -673,15 +673,24 @@ public: /// getTBAAAccessTagInfo - Get TBAA tag for a given memory access. llvm::MDNode *getTBAAAccessTagInfo(TBAAAccessInfo Info); - /// getTBAAMayAliasAccessInfo - Get TBAA information that represents - /// may-alias accesses. - TBAAAccessInfo getTBAAMayAliasAccessInfo(); - /// mergeTBAAInfoForCast - Get merged TBAA information for the purposes of /// type casts. TBAAAccessInfo mergeTBAAInfoForCast(TBAAAccessInfo SourceInfo, TBAAAccessInfo TargetInfo); + /// mergeTBAAInfoForConditionalOperator - Get merged TBAA information for the + /// purposes of conditional operator. + TBAAAccessInfo mergeTBAAInfoForConditionalOperator(TBAAAccessInfo InfoA, + TBAAAccessInfo InfoB); + + /// getTBAAInfoForSubobject - Get TBAA information for an access with a given + /// base lvalue. + TBAAAccessInfo getTBAAInfoForSubobject(LValue Base, QualType AccessType) { + if (Base.getTBAAInfo().isMayAlias()) + return TBAAAccessInfo::getMayAliasInfo(); + return getTBAAAccessInfo(AccessType); + } + bool isTypeConstant(QualType QTy, bool ExcludeCtorDtor); bool isPaddedAtomicType(QualType type); |