summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-04-27 00:39:37 +0000
committerManman Ren <mren@apple.com>2013-04-27 00:39:37 +0000
commit0e52166bed9ce245a9879615adbab64844b27a87 (patch)
tree643b942cf6611f56f01f68d445e7e8dae4c8d53b /clang/lib/CodeGen/CGExpr.cpp
parentcd67f97cb795832531a9c6ea646741c5471ee220 (diff)
downloadbcm5719-llvm-0e52166bed9ce245a9879615adbab64844b27a87.tar.gz
bcm5719-llvm-0e52166bed9ce245a9879615adbab64844b27a87.zip
Struct-path aware TBAA: fix handling of may_alias attribute.
llvm-svn: 180656
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index ea13de17abb..f426a52bcd2 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2588,8 +2588,8 @@ LValue CodeGenFunction::EmitLValueForField(LValue base,
getContext().getASTRecordLayout(field->getParent());
// Set the base type to be the base type of the base LValue and
// update offset to be relative to the base type.
- LV.setTBAABaseType(base.getTBAABaseType());
- LV.setTBAAOffset(base.getTBAAOffset() +
+ LV.setTBAABaseType(mayAlias ? getContext().CharTy : base.getTBAABaseType());
+ LV.setTBAAOffset(mayAlias ? 0 : base.getTBAAOffset() +
Layout.getFieldOffset(field->getFieldIndex()) /
getContext().getCharWidth());
}
OpenPOWER on IntegriCloud