summaryrefslogtreecommitdiff
path: root/devel/llvm60/files/clang/patch-head-r331066.diff
diff options
context:
space:
mode:
Diffstat (limited to 'devel/llvm60/files/clang/patch-head-r331066.diff')
-rw-r--r--devel/llvm60/files/clang/patch-head-r331066.diff40
1 files changed, 40 insertions, 0 deletions
diff --git a/devel/llvm60/files/clang/patch-head-r331066.diff b/devel/llvm60/files/clang/patch-head-r331066.diff
new file mode 100644
index 000000000000..7296a087bfb0
--- /dev/null
+++ b/devel/llvm60/files/clang/patch-head-r331066.diff
@@ -0,0 +1,40 @@
+r331066 | dim | 2018-03-16 19:04:13 +0100 (Fri, 16 Mar 2018) | 19 lines
+
+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
+
+Index: tools/clang/lib/CodeGen/CGExpr.cpp
+===================================================================
+--- tools/clang/lib/CodeGen/CGExpr.cpp (revision 331065)
++++ tools/clang/lib/CodeGen/CGExpr.cpp (revision 331066)
+@@ -1034,8 +1034,12 @@ Address CodeGenFunction::EmitPointerWithAlignment(
+ // 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(),