[CodeGen] Have a special function to get TBAA info for may-alias accesses

This is part of D37826 reworked to be a separate patch to
simplify review.

Differential Revision: https://reviews.llvm.org/D38408

llvm-svn: 314660
This commit is contained in:
Ivan A. Kosarev
2017-10-02 11:10:04 +00:00
parent 3ccd23e116
commit 5c8e7596e6
5 changed files with 23 additions and 8 deletions

View File

@@ -599,6 +599,12 @@ llvm::MDNode *CodeGenModule::getTBAAStructTagInfo(QualType BaseTy,
return TBAA->getTBAAStructTagInfo(BaseTy, AccessN, O);
}
llvm::MDNode *CodeGenModule::getTBAAMayAliasTypeInfo() {
if (!TBAA)
return nullptr;
return TBAA->getMayAliasTypeInfo();
}
/// Decorate the instruction with a TBAA tag. For both scalar TBAA
/// and struct-path aware TBAA, the tag has the same format:
/// base type, access type and offset.