Skip to content

Commit

Permalink
Update Clang for D20147 ("DebugInfo: New metadata representation for …
Browse files Browse the repository at this point in the history
…global variables.")

Differential Revision: http://reviews.llvm.org/D20415

llvm-svn: 281285
  • Loading branch information
pcc committed Sep 13, 2016
1 parent d4135bb commit eeb56ab
Show file tree
Hide file tree
Showing 31 changed files with 158 additions and 134 deletions.
16 changes: 10 additions & 6 deletions clang/lib/CodeGen/CGDebugInfo.cpp
Expand Up @@ -3606,8 +3606,8 @@ llvm::DIGlobalVariable *CGDebugInfo::CollectAnonRecordDecls(
}
// Use VarDecl's Tag, Scope and Line number.
GV = DBuilder.createGlobalVariable(DContext, FieldName, LinkageName, Unit,
LineNo, FieldTy,
Var->hasLocalLinkage(), Var, nullptr);
LineNo, FieldTy, Var->hasLocalLinkage());
Var->addDebugInfo(GV);
}
return GV;
}
Expand Down Expand Up @@ -3640,14 +3640,14 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
} else {
GV = DBuilder.createGlobalVariable(
DContext, DeclName, LinkageName, Unit, LineNo, getOrCreateType(T, Unit),
Var->hasLocalLinkage(), Var,
Var->hasLocalLinkage(), /*Expr=*/nullptr,
getOrCreateStaticDataMemberDeclarationOrNull(D));
Var->addDebugInfo(GV);
}
DeclCache[D->getCanonicalDecl()].reset(GV);
}

void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD,
llvm::Constant *Init) {
void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) {
assert(DebugKind >= codegenoptions::LimitedDebugInfo);
if (VD->hasAttr<NoDebugAttr>())
return;
Expand Down Expand Up @@ -3687,9 +3687,13 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD,
auto &GV = DeclCache[VD];
if (GV)
return;
llvm::DIExpression *InitExpr = nullptr;
if (Init.isInt())
InitExpr =
DBuilder.createConstantValueExpression(Init.getInt().getExtValue());
GV.reset(DBuilder.createGlobalVariable(
DContext, Name, StringRef(), Unit, getLineNumber(VD->getLocation()), Ty,
true, Init, getOrCreateStaticDataMemberDeclarationOrNull(VarD)));
true, InitExpr, getOrCreateStaticDataMemberDeclarationOrNull(VarD)));
}

llvm::DIScope *CGDebugInfo::getCurrentContextDescriptor(const Decl *D) {
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CGDebugInfo.h
Expand Up @@ -354,8 +354,8 @@ class CGDebugInfo {
/// Emit information about a global variable.
void EmitGlobalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl);

/// Emit global variable's debug info.
void EmitGlobalVariable(const ValueDecl *VD, llvm::Constant *Init);
/// Emit a constant global variable's debug info.
void EmitGlobalVariable(const ValueDecl *VD, const APValue &Init);

/// Emit C++ using directive.
void EmitUsingDirective(const UsingDirectiveDecl &UD);
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CGExpr.cpp
Expand Up @@ -1180,10 +1180,10 @@ CodeGenFunction::tryEmitAsConstant(DeclRefExpr *refExpr) {
// This should probably fire even for
if (isa<VarDecl>(value)) {
if (!getContext().DeclMustBeEmitted(cast<VarDecl>(value)))
EmitDeclRefExprDbgValue(refExpr, C);
EmitDeclRefExprDbgValue(refExpr, result.Val);
} else {
assert(isa<EnumConstantDecl>(value));
EmitDeclRefExprDbgValue(refExpr, C);
EmitDeclRefExprDbgValue(refExpr, result.Val);
}

// If we emitted a reference constant, we need to dereference that.
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CodeGenFunction.cpp
Expand Up @@ -1840,8 +1840,8 @@ Address CodeGenFunction::EmitMSVAListRef(const Expr *E) {
}

void CodeGenFunction::EmitDeclRefExprDbgValue(const DeclRefExpr *E,
llvm::Constant *Init) {
assert (Init && "Invalid DeclRefExpr initializer!");
const APValue &Init) {
assert(!Init.isUninit() && "Invalid DeclRefExpr initializer!");
if (CGDebugInfo *Dbg = getDebugInfo())
if (CGM.getCodeGenOpts().getDebugInfo() >= codegenoptions::LimitedDebugInfo)
Dbg->EmitGlobalVariable(E->getDecl(), Init);
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CodeGenFunction.h
Expand Up @@ -2810,7 +2810,7 @@ class CodeGenFunction : public CodeGenTypeCache {
LValue EmitStmtExprLValue(const StmtExpr *E);
LValue EmitPointerToDataMemberBinaryExpr(const BinaryOperator *E);
LValue EmitObjCSelectorLValue(const ObjCSelectorExpr *E);
void EmitDeclRefExprDbgValue(const DeclRefExpr *E, llvm::Constant *Init);
void EmitDeclRefExprDbgValue(const DeclRefExpr *E, const APValue &Init);

//===--------------------------------------------------------------------===//
// Scalar Expression Emission
Expand Down
14 changes: 8 additions & 6 deletions clang/test/CodeGen/2009-10-20-GlobalDebug.c
@@ -1,16 +1,18 @@
// REQUIRES: x86-registered-target
// RUN: %clang -target i386-apple-darwin10 -flto -S -g %s -o - | FileCheck %s

// CHECK: @main.localstatic = internal global i32 0, align 4, !dbg [[L:![0-9]+]]
// CHECK: @global = common global i32 0, align 4, !dbg [[G:![0-9]+]]

int global;
int main() {
static int localstatic;
return 0;
}

// CHECK: !DIGlobalVariable(name: "localstatic"
// CHECK: [[L]] = distinct !DIGlobalVariable(name: "localstatic"
// CHECK-NOT: linkageName:
// CHECK-SAME: line: 5,
// CHECK-SAME: variable: i32* @main.localstatic
// CHECK: !DIGlobalVariable(name: "global"
// CHECK-SAME: line: 9,
// CHECK: [[G]] = distinct !DIGlobalVariable(name: "global"
// CHECK-NOT: linkageName:
// CHECK-SAME: line: 3,
// CHECK-SAME: variable: i32* @global
// CHECK-SAME: line: 7,
3 changes: 2 additions & 1 deletion clang/test/CodeGen/2010-08-10-DbgConstant.c
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -S -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
// CHECK: !DIGlobalVariable(
// CHECK: !DIGlobalVariable({{.*}}, expr: [[EXPR:![0-9]+]])
// CHECK: [[EXPR]] = !DIExpression(DW_OP_constu, 201, DW_OP_stack_value)

static const unsigned int ro = 201;
void bar(int);
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/debug-info-packed-struct.c
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -x c -debug-info-kind=limited -emit-llvm -triple x86_64-apple-darwin -o - %s | FileCheck %s

// CHECK: %struct.layout3 = type <{ i8, [3 x i8], %struct.size8_pack4, i8, [3 x i8] }>
// CHECK: %struct.layout0 = type { i8, %struct.size8, i8 }
// CHECK: %struct.layout1 = type <{ i8, %struct.size8_anon, i8, [2 x i8] }>
// CHECK: %struct.layout2 = type <{ i8, %struct.size8_pack1, i8 }>
// CHECK: %struct.layout3 = type <{ i8, [3 x i8], %struct.size8_pack4, i8, [3 x i8] }>

// ---------------------------------------------------------------------
// Not packed.
Expand Down Expand Up @@ -85,7 +85,7 @@ struct layout3 {
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs12",
// CHECK-SAME: {{.*}}size: 1, align: 32, offset: 96, flags: DIFlagBitField, extraData: i64 96)

struct layout3 l3;
struct layout0 l0;
struct layout1 l1;
struct layout2 l2;
struct layout3 l3;
4 changes: 3 additions & 1 deletion clang/test/CodeGen/debug-info-static.c
@@ -1,6 +1,8 @@
// RUN: %clang_cc1 -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s

// CHECK: !DIGlobalVariable({{.*}}variable: i32* @f.xyzzy
// CHECK: @f.xyzzy = internal global i32 0, align 4, !dbg [[XYZZY:![0-9]+]]

// CHECK: [[XYZZY]] = distinct !DIGlobalVariable
void f(void)
{
static int xyzzy;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenCXX/debug-info-access.cpp
Expand Up @@ -39,6 +39,6 @@ union U {
// CHECK-SAME: flags: DIFlagPrototyped,
void free() {}

U u;
A a;
B b;
U u;
5 changes: 3 additions & 2 deletions clang/test/CodeGenCXX/debug-info-alias.cpp
Expand Up @@ -14,8 +14,6 @@ bar
}

// CHECK: !DIGlobalVariable(name: "bi",{{.*}} type: [[BINT:![0-9]+]]
// CHECK: [[BINT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<int>"
// CHECK-SAME: line: 42,
x::bar<int> bi;
// CHECK: !DIGlobalVariable(name: "bf",{{.*}} type: [[BFLOAT:![0-9]+]]
// CHECK: [[BFLOAT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<float>"
Expand All @@ -37,3 +35,6 @@ tv<int> *tvp;
using v = void;
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "v"
v *vp;

// CHECK: [[BINT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<int>"
// CHECK-SAME: line: 42,
3 changes: 2 additions & 1 deletion clang/test/CodeGenCXX/debug-info-anon-namespace.cpp
Expand Up @@ -19,8 +19,9 @@ int *b2 = &a2;


// PS4: [[NS:![0-9]+]] = !DINamespace
// PS4: [[CU:![0-9]+]] = distinct !DICompileUnit
// PS4: [[NS2:![0-9]+]] = !DINamespace
// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0, entity: [[NS]])
// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[CU]], entity: [[NS]])
// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[NS]], entity: [[NS2]], line: {{[0-9]+}})
// NON-PS4-NOT: !DIImportedEntity

2 changes: 1 addition & 1 deletion clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp
Expand Up @@ -45,8 +45,8 @@ void instantiate(int x) {
}

// CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE:.*]], line: 6,{{.*}} isLocal: true, isDefinition: true
// CHECK: [[FILE]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp",
// CHECK: !DIGlobalVariable(name: "d",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
// CHECK: [[FILE]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp",
// CHECK: !DIGlobalVariable(name: "a",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
// CHECK: !DIGlobalVariable(name: "b",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
// CHECK: !DIGlobalVariable(name: "result", {{.*}} isLocal: false, isDefinition: true
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGenCXX/debug-info-cxx1y.cpp
Expand Up @@ -3,9 +3,6 @@
// CHECK: imports: [[IMPS:![0-9]*]]
// CHECK: [[EMPTY:![0-9]*]] = !{}

// CHECK: [[FOO:![0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo",
// CHECK-SAME: elements: [[EMPTY]]

// CHECK: [[IMPS]] = !{[[IMP:![0-9]*]]}
// CHECK: [[IMP]] = !DIImportedEntity(
// CHECK-SAME: entity: [[F3:![0-9]*]]
Expand All @@ -15,6 +12,9 @@
// CHECK: [[TYPE_LIST]] = !{[[INT:![0-9]*]]}
// CHECK: [[INT]] = !DIBasicType(name: "int"

// CHECK: [[FOO:![0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo",
// CHECK-SAME: elements: [[EMPTY]]

// FIXME: The context of this definition should be the CU/file scope, not the class.
// CHECK: !DISubprogram(name: "func", {{.*}} scope: [[FOO]]
// CHECK-SAME: type: [[SUBROUTINE_TYPE]]
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenCXX/debug-info-method.cpp
@@ -1,10 +1,10 @@
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -debug-info-kind=limited %s -o - | FileCheck %s
// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type
// CHECK: ![[A:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_class_type, name: "A",{{.*}} identifier: "_ZTS1A")
// CHECK: !DISubprogram(name: "foo", linkageName: "_ZN1A3fooEiS_3$_0"
// CHECK-SAME: DIFlagProtected
// CHECK: ![[THISTYPE:[0-9]+]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[A]]
// CHECK-SAME: DIFlagArtificial
// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type
// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: ![[MEMFUNTYPE:[0-9]+]]
// CHECK: ![[MEMFUNTYPE]] = !DISubroutineType({{(cc: DW_CC_BORLAND_thiscall, )?}}types: ![[MEMFUNARGS:[0-9]+]])
// CHECK: ![[MEMFUNARGS]] = {{.*}}, ![[THISTYPE]],
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGenCXX/debug-info-ms-abi.cpp
Expand Up @@ -11,11 +11,14 @@ struct Foo {
Foo f;
Foo::Nested n;

// CHECK: ![[Nested:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested",
// CHECK-SAME: identifier: ".?AUNested@Foo@@"

// CHECK: ![[Foo:[^ ]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo",
// CHECK-SAME: elements: ![[elements:[0-9]+]]
// CHECK-SAME: identifier: ".?AUFoo@@"

// CHECK: ![[elements]] = !{![[vshape:[0-9]+]], ![[vptr:[0-9]+]], ![[Nested:[0-9]+]], ![[f:[0-9]+]], ![[g:[0-9]+]], ![[h:[0-9]+]]}
// CHECK: ![[elements]] = !{![[vshape:[0-9]+]], ![[vptr:[0-9]+]], ![[Nested]], ![[f:[0-9]+]], ![[g:[0-9]+]], ![[h:[0-9]+]]}

// CHECK: ![[vshape]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: null, size: 96)

Expand All @@ -24,9 +27,6 @@ Foo::Nested n;

// CHECK: ![[vptr_ty]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[vshape]], size: 32

// CHECK: ![[Nested]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested",
// CHECK-SAME: identifier: ".?AUNested@Foo@@"

// CHECK: ![[f]] = !DISubprogram(name: "f",
// CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0,
// CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,
Expand Down
3 changes: 2 additions & 1 deletion clang/test/CodeGenCXX/debug-info-ms-anonymous-tag.cpp
Expand Up @@ -4,7 +4,6 @@ typedef struct {
} test1;

test1 gv1;
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "test1"

struct {
} test2;
Expand All @@ -18,3 +17,5 @@ test3 gv3;
void *use_test3 = &gv3;

// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "<unnamed-type-test3>"

// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "test1"
3 changes: 2 additions & 1 deletion clang/test/CodeGenCXX/debug-info-ms-ptr-to-member.cpp
Expand Up @@ -23,7 +23,6 @@ int Incomplete::**ppmd;
void (Incomplete::**ppmf)();

// CHECK: distinct !DIGlobalVariable(name: "pmd_a", {{.*}} type: ![[pmd_a:[^, ]*]], {{.*}})
// CHECK: ![[pmd_a]] = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !{{.*}}, size: 32, flags: DIFlagSingleInheritance, {{.*}})
// CHECK: distinct !DIGlobalVariable(name: "pmd_b", {{.*}} type: ![[pmd_b:[^, ]*]], {{.*}})
// CHECK: ![[pmd_b]] = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !{{.*}}, size: 32, flags: DIFlagMultipleInheritance, {{.*}})
// CHECK: distinct !DIGlobalVariable(name: "pmd_c", {{.*}} type: ![[pmd_c:[^, ]*]], {{.*}})
Expand All @@ -50,3 +49,5 @@ void (Incomplete::**ppmf)();
// CHECK: distinct !DIGlobalVariable(name: "ppmf", {{.*}} type: ![[ppmf:[^, ]*]], {{.*}})
// CHECK: ![[ppmf]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[ppmf2:[^ ]*]], size: 64, align: 64)
// CHECK: ![[ppmf2]] = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !{{[0-9]*}}, extraData: !{{[0-9]*}}){{$}}

// CHECK: ![[pmd_a]] = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !{{.*}}, size: 32, flags: DIFlagSingleInheritance, {{.*}})
50 changes: 25 additions & 25 deletions clang/test/CodeGenCXX/debug-info-ms-vbase.cpp
Expand Up @@ -2,11 +2,27 @@

// Tests virtual bases in the MS ABI.

struct POD { int pod; };
// CHECK: ![[NoPrimaryBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "NoPrimaryBase",
// CHECK-SAME: elements: ![[elements:[0-9]+]]

struct DynamicNoVFPtr : virtual POD { };
// CHECK: ![[elements]] = !{![[NoPrimaryBase_base:[0-9]+]]}

DynamicNoVFPtr dynamic_no_vfptr;
// CHECK: ![[NoPrimaryBase_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[NoPrimaryBase]],
// CHECK-SAME: baseType: ![[HasVirtualMethod:[0-9]+]], offset: 4, flags: DIFlagVirtual)

// CHECK: ![[HasVirtualMethod]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasVirtualMethod"

// CHECK: ![[HasPrimaryBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasPrimaryBase",
// CHECK-SAME: elements: ![[elements:[0-9]+]]

// CHECK: ![[elements]] = !{![[SecondaryVTable_base:[0-9]+]], ![[HasVirtualMethod_base:[0-9]+]], ![[vshape:[0-9]+]]}

// CHECK: ![[SecondaryVTable_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]],
// CHECK-SAME: baseType: ![[SecondaryVTable:[0-9]+]], offset: 4, flags: DIFlagVirtual)

// CHECK: ![[SecondaryVTable]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "SecondaryVTable"

// CHECK: ![[HasVirtualMethod_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]], baseType: ![[HasVirtualMethod]])

// CHECK: ![[DynamicNoVFPtr:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "DynamicNoVFPtr",
// CHECK-SAME: elements: ![[elements:[0-9]+]]
Expand All @@ -18,37 +34,21 @@ DynamicNoVFPtr dynamic_no_vfptr;

// CHECK: ![[POD]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "POD"

struct HasVirtualMethod { virtual void f(); };

struct NoPrimaryBase : virtual HasVirtualMethod { };
struct POD { int pod; };

NoPrimaryBase no_primary_base;
struct DynamicNoVFPtr : virtual POD { };

// CHECK: ![[NoPrimaryBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "NoPrimaryBase",
// CHECK-SAME: elements: ![[elements:[0-9]+]]
DynamicNoVFPtr dynamic_no_vfptr;

// CHECK: ![[elements]] = !{![[NoPrimaryBase_base:[0-9]+]]}
struct HasVirtualMethod { virtual void f(); };

// CHECK: ![[NoPrimaryBase_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[NoPrimaryBase]],
// CHECK-SAME: baseType: ![[HasVirtualMethod:[0-9]+]], offset: 4, flags: DIFlagVirtual)
struct NoPrimaryBase : virtual HasVirtualMethod { };

// CHECK: ![[HasVirtualMethod]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasVirtualMethod"
NoPrimaryBase no_primary_base;

struct SecondaryVTable { virtual void g(); };

struct HasPrimaryBase : virtual SecondaryVTable, HasVirtualMethod { };

HasPrimaryBase has_primary_base;

// CHECK: ![[HasPrimaryBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasPrimaryBase",
// CHECK-SAME: elements: ![[elements:[0-9]+]]

// CHECK: ![[elements]] = !{![[SecondaryVTable_base:[0-9]+]], ![[HasVirtualMethod_base:[0-9]+]], ![[vshape:[0-9]+]]}

// CHECK: ![[SecondaryVTable_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]],
// CHECK-SAME: baseType: ![[SecondaryVTable:[0-9]+]], offset: 4, flags: DIFlagVirtual)

// CHECK: ![[SecondaryVTable]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "SecondaryVTable"

// CHECK: ![[HasVirtualMethod_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]], baseType: ![[HasVirtualMethod]])

4 changes: 2 additions & 2 deletions clang/test/CodeGenCXX/debug-info-namespace.cpp
Expand Up @@ -55,8 +55,6 @@ void B::func_fwd() {}
// This should work even if 'i' and 'func' were declarations & not definitions,
// but it doesn't yet.

// CHECK: [[CU:![0-9]+]] = distinct !DICompileUnit(
// CHECK-SAME: imports: [[MODULES:![0-9]*]]
// CHECK: [[I:![0-9]+]] = distinct !DIGlobalVariable(name: "i",{{.*}} scope: [[NS:![0-9]+]],
// CHECK: [[NS]] = !DINamespace(name: "B", scope: [[CTXT:![0-9]+]], file: [[FOOCPP:![0-9]+]], line: 1)
// CHECK: [[FOOCPP]] = !DIFile(filename: "foo.cpp"
Expand All @@ -65,6 +63,8 @@ void B::func_fwd() {}
// CHECK: [[VAR_FWD:![0-9]+]] = distinct !DIGlobalVariable(name: "var_fwd",{{.*}} scope: [[NS]],
// CHECK-SAME: line: 44
// CHECK-SAME: isDefinition: true
// CHECK: [[CU:![0-9]+]] = distinct !DICompileUnit(
// CHECK-SAME: imports: [[MODULES:![0-9]*]]
// CHECK: [[MODULES]] = !{[[M1:![0-9]+]], [[M2:![0-9]+]], [[M3:![0-9]+]], [[M4:![0-9]+]], [[M5:![0-9]+]], [[M6:![0-9]+]], [[M7:![0-9]+]], [[M8:![0-9]+]], [[M9:![0-9]+]], [[M10:![0-9]+]], [[M11:![0-9]+]], [[M12:![0-9]+]], [[M13:![0-9]+]], [[M14:![0-9]+]], [[M15:![0-9]+]], [[M16:![0-9]+]], [[M17:![0-9]+]]}
// CHECK: [[M1]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[CTXT]], entity: [[NS]], line: 15)

Expand Down

0 comments on commit eeb56ab

Please sign in to comment.