Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Mar 2018 18:04:13 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331066 - head/contrib/llvm/tools/clang/lib/CodeGen
Message-ID:  <201803161804.w2GI4Di5052404@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Fri Mar 16 18:04:13 2018
New Revision: 331066
URL: https://svnweb.freebsd.org/changeset/base/331066

Log:
  Pull in r321999 from upstream clang trunk (by Ivan A. Kosarev):
  
    [CodeGen] Fix TBAA info for accesses to members of base classes
  
    Resolves:
    Bug 35724 - regression (r315984): fatal error: error in backend:
    Broken function found (Did not see access type in access path!)
    https://bugs.llvm.org/show_bug.cgi?id=35724
  
    Differential Revision: https://reviews.llvm.org/D41547
  
  This fixes "Did not see access type in access path" fatal errors when
  building the devel/gdb port (version 8.1).
  
  Reported by:	jbeich
  PR:		226658
  MFC after:	3 months
  X-MFC-With:	r327952

Modified:
  head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp

Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp	Fri Mar 16 17:50:44 2018	(r331065)
+++ head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp	Fri Mar 16 18:04:13 2018	(r331066)
@@ -1034,8 +1034,12 @@ Address CodeGenFunction::EmitPointerWithAlignment(cons
     // 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(),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803161804.w2GI4Di5052404>