diff options
author | Manman Ren <mren@apple.com> | 2013-04-27 00:39:37 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-04-27 00:39:37 +0000 |
commit | 975d83c291821de340eef3c3498104172b375f79 (patch) | |
tree | 01a20626dd82db5df9b70ce94503f29f9411fe50 /lib/CodeGen | |
parent | 50be9041fcca4d77c09f120e720d75be703b6ea0 (diff) |
Struct-path aware TBAA: fix handling of may_alias attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index ea13de17ab..f426a52bcd 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/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()); } |