summaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/clang/lib
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-03-16 18:04:13 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-03-16 18:04:13 +0000
commitbf22ec69efaffe71541cd26095aa3d02e44d6a5c (patch)
tree57887f75042bc0dc130628acada2601806e9d694 /contrib/llvm/tools/clang/lib
parent077d36ae021ca14b90042db269fb241024c20a5d (diff)
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib')
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
index 3f81be00f32d..ac82b3eebc3c 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
@@ -1034,8 +1034,12 @@ Address CodeGenFunction::EmitPointerWithAlignment(const Expr *E,
// Derived-to-base conversions.
case CK_UncheckedDerivedToBase:
case CK_DerivedToBase: {
- Address Addr = EmitPointerWithAlignment(CE->getSubExpr(), BaseInfo,
- TBAAInfo);
+ // TODO: Support accesses to members of base classes in TBAA. For now, we
+ // conservatively pretend that the complete object is of the base class
+ // type.
+ if (TBAAInfo)
+ *TBAAInfo = CGM.getTBAAAccessInfo(E->getType());
+ Address Addr = EmitPointerWithAlignment(CE->getSubExpr(), BaseInfo);
auto Derived = CE->getSubExpr()->getType()->getPointeeCXXRecordDecl();
return GetAddressOfBaseClass(Addr, Derived,
CE->path_begin(), CE->path_end(),