summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorIvan A. Kosarev <ikosarev@accesssoftek.com>2017-10-13 16:47:22 +0000
committerIvan A. Kosarev <ikosarev@accesssoftek.com>2017-10-13 16:47:22 +0000
commit9029564e8c8edafa078b91b0f6b16b19438dabf7 (patch)
treebb1642da704959e6dbaf19e6dee6c24457c28341 /clang/lib/CodeGen/CGExpr.cpp
parent8d810fee436510db408fccb27a2c73076cf16536 (diff)
downloadbcm5719-llvm-9029564e8c8edafa078b91b0f6b16b19438dabf7.tar.gz
bcm5719-llvm-9029564e8c8edafa078b91b0f6b16b19438dabf7.zip
[CodeGen] EmitLoadOfPointer() to generate TBAA info along with LValue base info
This patch should not bring in any functional changes. Differential Revision: https://reviews.llvm.org/D38791 llvm-svn: 315704
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index ec1f30084e8..bb2e8550bd2 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2165,7 +2165,11 @@ LValue CodeGenFunction::EmitLoadOfReferenceLValue(Address RefAddr,
Address CodeGenFunction::EmitLoadOfPointer(Address Ptr,
const PointerType *PtrTy,
- LValueBaseInfo *BaseInfo) {
+ LValueBaseInfo *BaseInfo,
+ TBAAAccessInfo *TBAAInfo) {
+ if (TBAAInfo)
+ *TBAAInfo = CGM.getTBAAAccessInfo(PtrTy->getPointeeType());
+
llvm::Value *Addr = Builder.CreateLoad(Ptr);
return Address(Addr, getNaturalTypeAlignment(PtrTy->getPointeeType(),
BaseInfo,
@@ -2175,9 +2179,9 @@ Address CodeGenFunction::EmitLoadOfPointer(Address Ptr,
LValue CodeGenFunction::EmitLoadOfPointerLValue(Address PtrAddr,
const PointerType *PtrTy) {
LValueBaseInfo BaseInfo;
- Address Addr = EmitLoadOfPointer(PtrAddr, PtrTy, &BaseInfo);
- return MakeAddrLValue(Addr, PtrTy->getPointeeType(), BaseInfo,
- CGM.getTBAAAccessInfo(PtrTy->getPointeeType()));
+ TBAAAccessInfo TBAAInfo;
+ Address Addr = EmitLoadOfPointer(PtrAddr, PtrTy, &BaseInfo, &TBAAInfo);
+ return MakeAddrLValue(Addr, PtrTy->getPointeeType(), BaseInfo, TBAAInfo);
}
static LValue EmitGlobalVarDeclLValue(CodeGenFunction &CGF,
OpenPOWER on IntegriCloud