]> granicus.if.org Git - clang/commitdiff
Revert "Debug info: Use record layout to find vbase offsets instead of vtables"
authorReid Kleckner <reid@kleckner.net>
Thu, 7 Aug 2014 20:36:48 +0000 (20:36 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 7 Aug 2014 20:36:48 +0000 (20:36 +0000)
This reverts commit r215137.

This doesn't work at all, an offset-offset is probably different than an
offset.  I'm scared that this passed our normal test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215141 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenCXX/debug-info.cpp

index a736d7de25ae217bcb4d12e4805db08c93b6d1f1..ddb8a838875a7c334149093a77a390e33b47a9d4 100644 (file)
@@ -1195,7 +1195,9 @@ CollectCXXBases(const CXXRecordDecl *RD, llvm::DIFile Unit,
     if (BI.isVirtual()) {
       // virtual base offset offset is -ve. The code generator emits dwarf
       // expression where it expects +ve number.
-      BaseOffset = 0 - RL.getVBaseClassOffset(Base).getQuantity();
+      BaseOffset =
+        0 - CGM.getItaniumVTableContext()
+               .getVirtualBaseOffsetOffset(RD, Base).getQuantity();
       BFlags = llvm::DIDescriptor::FlagVirtual;
     } else
       BaseOffset = CGM.getContext().toBits(RL.getBaseClassOffset(Base));
index a3b75e2e14308893c584b64e5c1e26eacfd92757..7c89dfc04ce1bcdf3fcf3ae8bf32dfcff82faa8d 100644 (file)
@@ -1,6 +1,4 @@
 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -g %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple i686-pc-windows-msvc -emit-llvm -g %s -o - | FileCheck %s --check-prefix=MSVC
-
 template<typename T> struct Identity {
   typedef T Type;
 };
@@ -45,18 +43,14 @@ namespace VirtualDtor {
 }
 
 namespace VirtualBase {
-  struct A { int a; };
-  struct B : virtual A { int b; };
+  struct A { };
+  struct B : virtual A { };
 
   void f() {
     B b;
   }
 }
 
-// MSVC: [[VBASE_B:![0-9]+]] = metadata !{i32 {{.*}}, metadata !"B", i32 {{[0-9]*}}, i64 96, i64 32, i32 0, i32 0, null, metadata [[ZZZ:![0-9]+]], i32 0, {{.*}}} ; [ DW_TAG_structure_type ] [B] [line 49, size 96, align 32, offset 0] [def] [from ]
-// MSVC: [[ZZZ]] = metadata !{metadata [[VBASE_A_IN_B:![0-9]+]],
-// MSVC: [[VBASE_A_IN_B]] = metadata !{i32 786460, null, metadata [[VBASE_B]], null, i32 0, i64 0, i64 0, i64 -8, i32 32, metadata !{{[0-9]*}}} ; [ DW_TAG_inheritance ] [line 0, size 0, align 0, offset 18446744073709551608] [from A]
-
 namespace b5249287 {
 template <typename T> class A {
   struct B;