From 92e0abcf102d39387eef8758f9d204d1d4d5a218 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 15 Apr 2016 15:55:45 +0000 Subject: [PATCH] Update to match LLVM changes for PR27284. (Reverse the ownership between DICompileUnit and DISubprogram.) http://reviews.llvm.org/D19034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266445 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 10 ++-- test/CodeGen/debug-info-scope-file.c | 2 +- test/CodeGen/debug-info.c | 8 +-- test/CodeGenCXX/PR20038.cpp | 2 +- .../CodeGenCXX/debug-info-anon-union-vars.cpp | 4 +- .../debug-info-function-context.cpp | 4 +- test/CodeGenCXX/debug-info-namespace.cpp | 14 +++-- .../debug-info-ptr-to-member-function.cpp | 10 ++-- .../CodeGenCXX/debug-info-template-member.cpp | 19 ++++--- test/CodeGenCXX/debug-info.cpp | 7 ++- test/CodeGenCXX/debug-lambda-expressions.cpp | 55 +++++++++---------- test/CodeGenCXX/debug-lambda-this.cpp | 4 +- .../CodeGenCXX/linetable-virtual-variadic.cpp | 4 -- test/CodeGenObjC/debug-info-block-type.m | 15 +++-- test/CodeGenObjC/debug-property-synth.m | 4 +- test/Modules/ExtDebugInfo.m | 15 ++--- test/Modules/ModuleDebugInfo.cpp | 6 +- test/Modules/ModuleDebugInfo.m | 31 +++++------ 18 files changed, 105 insertions(+), 109 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 4b7657bb35..54b5f2fc42 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2793,11 +2793,11 @@ void CGDebugInfo::EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc, unsigned LineNo = getLineNumber(Loc); unsigned ScopeLine = 0; - DBuilder.createFunction(FDContext, Name, LinkageName, Unit, LineNo, - getOrCreateFunctionType(D, FnType, Unit), - false /*internalLinkage*/, true /*definition*/, - ScopeLine, Flags, CGM.getLangOpts().Optimize, - TParamsArray.get(), getFunctionDeclaration(D)); + DBuilder.retainType(DBuilder.createFunction( + FDContext, Name, LinkageName, Unit, LineNo, + getOrCreateFunctionType(D, FnType, Unit), false /*internalLinkage*/, + false /*definition*/, ScopeLine, Flags, CGM.getLangOpts().Optimize, + TParamsArray.get(), getFunctionDeclaration(D))); } void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc) { diff --git a/test/CodeGen/debug-info-scope-file.c b/test/CodeGen/debug-info-scope-file.c index 296ec05826..94123bbc49 100644 --- a/test/CodeGen/debug-info-scope-file.c +++ b/test/CodeGen/debug-info-scope-file.c @@ -6,8 +6,8 @@ // CHECK: ret void, !dbg [[F1_LINE:![0-9]*]] // CHECK: ret void, !dbg [[F2_LINE:![0-9]*]] // CHECK: [[F1:![0-9]*]] = distinct !DISubprogram(name: "f1",{{.*}} isDefinition: true -// CHECK: [[F2:![0-9]*]] = distinct !DISubprogram(name: "f2",{{.*}} isDefinition: true // CHECK: [[F1_LINE]] = !DILocation({{.*}}, scope: [[F1]]) +// CHECK: [[F2:![0-9]*]] = distinct !DISubprogram(name: "f2",{{.*}} isDefinition: true // CHECK: [[F2_LINE]] = !DILocation({{.*}}, scope: [[F2]]) void f1() { diff --git a/test/CodeGen/debug-info.c b/test/CodeGen/debug-info.c index d122e7fe5c..f0215cc923 100644 --- a/test/CodeGen/debug-info.c +++ b/test/CodeGen/debug-info.c @@ -7,7 +7,7 @@ void convert(void) { // PR2784 -struct OPAQUE; // CHECK: DW_TAG_structure_type +struct OPAQUE; // CHECK-DAG: DW_TAG_structure_type, name: "OPAQUE" typedef struct OPAQUE *PTR; PTR p; @@ -42,19 +42,19 @@ struct foo2 foo2; // Radar 7325611 -// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "barfoo" +// CHECK-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "barfoo" typedef int barfoo; barfoo foo() { } -// CHECK: __uint128_t +// CHECK-DAG: __uint128_t __uint128_t foo128 () { __uint128_t int128 = 44; return int128; } -// CHECK: uint64x2_t +// CHECK-DAG: uint64x2_t typedef unsigned long long uint64_t; typedef uint64_t uint64x2_t __attribute__((ext_vector_type(2))); uint64x2_t extvectbar[4]; diff --git a/test/CodeGenCXX/PR20038.cpp b/test/CodeGenCXX/PR20038.cpp index 2d7043dcda..095705f389 100644 --- a/test/CodeGenCXX/PR20038.cpp +++ b/test/CodeGenCXX/PR20038.cpp @@ -7,8 +7,8 @@ extern bool b; // CHECK: call {{.*}}, !dbg [[DTOR_CALL1_LOC:![0-9]*]] // CHECK: call {{.*}}, !dbg [[DTOR_CALL2_LOC:![0-9]*]] // CHECK: [[FUN1:.*]] = distinct !DISubprogram(name: "fun1",{{.*}} isDefinition: true -// CHECK: [[FUN2:.*]] = distinct !DISubprogram(name: "fun2",{{.*}} isDefinition: true // CHECK: [[DTOR_CALL1_LOC]] = !DILocation(line: [[@LINE+1]], scope: [[FUN1]]) void fun1() { b && (C(), 1); } +// CHECK: [[FUN2:.*]] = distinct !DISubprogram(name: "fun2",{{.*}} isDefinition: true // CHECK: [[DTOR_CALL2_LOC]] = !DILocation(line: [[@LINE+1]], scope: [[FUN2]]) bool fun2() { return (C(), b) && 0; } diff --git a/test/CodeGenCXX/debug-info-anon-union-vars.cpp b/test/CodeGenCXX/debug-info-anon-union-vars.cpp index 5b0370eb74..80742250d8 100644 --- a/test/CodeGenCXX/debug-info-anon-union-vars.cpp +++ b/test/CodeGenCXX/debug-info-anon-union-vars.cpp @@ -44,8 +44,8 @@ void instantiate(int x) { buildBytes(x); } -// CHECK: [[FILE:.*]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp", -// CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true +// 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: !DIGlobalVariable(name: "a",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true // CHECK: !DIGlobalVariable(name: "b",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true diff --git a/test/CodeGenCXX/debug-info-function-context.cpp b/test/CodeGenCXX/debug-info-function-context.cpp index 24f9f1bda6..47a8d4d602 100644 --- a/test/CodeGenCXX/debug-info-function-context.cpp +++ b/test/CodeGenCXX/debug-info-function-context.cpp @@ -26,11 +26,11 @@ int global_namespace_variable = 1; // function has the file as a context. // CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp", +// CHECK: ![[NS:.*]] = !DINamespace(name: "ns" // CHECK: !DISubprogram(name: "member_function",{{.*}} scope: !"_ZTS1C",{{.*}} isDefinition: true // CHECK: !DISubprogram(name: "static_member_function",{{.*}} scope: !"_ZTS1C",{{.*}} isDefinition: true // CHECK: !DISubprogram(name: "global_function",{{.*}} scope: ![[FILE]],{{.*}} isDefinition: true -// CHECK: !DISubprogram(name: "global_namespace_function",{{.*}} scope: ![[NS:[0-9]+]],{{.*}} isDefinition: true -// CHECK: ![[NS]] = !DINamespace(name: "ns" +// CHECK: !DISubprogram(name: "global_namespace_function",{{.*}} scope: ![[NS]],{{.*}} isDefinition: true diff --git a/test/CodeGenCXX/debug-info-namespace.cpp b/test/CodeGenCXX/debug-info-namespace.cpp index bebb24ab5d..5cdf91bc1b 100644 --- a/test/CodeGenCXX/debug-info-namespace.cpp +++ b/test/CodeGenCXX/debug-info-namespace.cpp @@ -67,10 +67,7 @@ void B::func_fwd() {} // CHECK: [[BAR:![0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", // CHECK-SAME: line: 6 // CHECK-SAME: DIFlagFwdDecl -// CHECK: [[F1:![0-9]+]] = distinct !DISubprogram(name: "f1",{{.*}} line: 4 -// CHECK-SAME: isDefinition: true -// CHECK: [[FUNC:![0-9]+]] = distinct !DISubprogram(name: "func",{{.*}} isDefinition: true -// CHECK: [[FUNC_FWD:![0-9]+]] = distinct !DISubprogram(name: "func_fwd",{{.*}} line: 47,{{.*}} isDefinition: true + // CHECK: [[I:![0-9]+]] = !DIGlobalVariable(name: "i",{{.*}} scope: [[NS]], // CHECK: [[VAR_FWD:![0-9]+]] = !DIGlobalVariable(name: "var_fwd",{{.*}} scope: [[NS]], // CHECK-SAME: line: 44 @@ -82,11 +79,15 @@ void B::func_fwd() {} // CHECK: [[M3]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, name: "E", scope: [[CU]], entity: [[CTXT]], line: 19) // CHECK: [[M4]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[LEX2:![0-9]+]], entity: [[NS]], line: 23) // CHECK: [[LEX2]] = distinct !DILexicalBlock(scope: [[LEX1:![0-9]+]], file: [[FOOCPP]], -// CHECK: [[LEX1]] = distinct !DILexicalBlock(scope: [[FUNC]], file: [[FOOCPP]], +// CHECK: [[LEX1]] = distinct !DILexicalBlock(scope: [[FUNC:![0-9]+]], file: [[FOOCPP]], +// CHECK: [[FUNC]] = distinct !DISubprogram(name: "func",{{.*}} isDefinition: true + // CHECK: [[M5]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[FUNC]], entity: [[CTXT]], // CHECK: [[M6]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FOO:!"_ZTSN1A1B3fooE"]], line: 27) // CHECK: [[M7]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[BAR:!"_ZTSN1A1B3barE"]] -// CHECK: [[M8]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[F1]] +// CHECK: [[M8]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[F1:![0-9]+]] +// CHECK: [[F1:![0-9]+]] = distinct !DISubprogram(name: "f1",{{.*}} line: 4 +// CHECK-SAME: isDefinition: true // CHECK: [[M9]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[I]] // CHECK: [[M10]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[BAZ:![0-9]+]] // CHECK: [[BAZ]] = !DIDerivedType(tag: DW_TAG_typedef, name: "baz", scope: [[NS]], file: [[FOOCPP]], @@ -100,6 +101,7 @@ void B::func_fwd() {} // CHECK-SAME: scope: [[NS]], file: [[FOOCPP]], line: 9 // CHECK: [[M15]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[VAR_FWD:![0-9]+]] // CHECK: [[M16]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FUNC_FWD:![0-9]+]] +// CHECK: [[FUNC_FWD]] = distinct !DISubprogram(name: "func_fwd",{{.*}} line: 47,{{.*}} isDefinition: true // CHECK: [[M17]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[CTXT]], entity: [[I]] // CHECK-GMLT: [[CU:![0-9]+]] = distinct !DICompileUnit( diff --git a/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp b/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp index cac16b6008..a7e02e4813 100644 --- a/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp +++ b/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp @@ -7,15 +7,15 @@ struct T { void foo(int (T::*method)()) {} -// A pointer to a member function is a pair of function- and this-pointer. -// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, -// DARWIN-X64-SAME: size: 128 -// WIN32-X64-SAME: size: 64 - struct Incomplete; int (Incomplete::**bar)(); +// A pointer to a member function is a pair of function- and this-pointer. // CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, // DARWIN-X64-SAME: size: 128 // WIN32-X64-NOT: size: // CHECK-SAME: extraData: {{.*}}) + +// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, +// DARWIN-X64-SAME: size: 128 +// WIN32-X64-SAME: size: 64 diff --git a/test/CodeGenCXX/debug-info-template-member.cpp b/test/CodeGenCXX/debug-info-template-member.cpp index b94ff05df4..a6ba82aa94 100644 --- a/test/CodeGenCXX/debug-info-template-member.cpp +++ b/test/CodeGenCXX/debug-info-template-member.cpp @@ -50,15 +50,6 @@ inline int add3(int x) { // CHECK: [[ELEM_X]] = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !"_ZTS4elem" // CHECK-SAME: baseType: !"_ZTS4virtI4elemE" -// Check that the member function template specialization and implicit special -// members (the default ctor) refer to their class by scope, even though they -// didn't appear in the class's member list (C_MEM). This prevents the functions -// from being added to type units, while still appearing in the type -// declaration/reference in the compile unit. -// CHECK: !DISubprogram(name: "MyClass" -// CHECK-SAME: scope: !"_ZTS7MyClass" -// CHECK: !DISubprogram(name: "add<2>" -// CHECK-SAME: scope: !"_ZTS7MyClass" template struct outer { @@ -98,3 +89,13 @@ inline void f1() { void f2() { virt d; // emit 'virt' } + +// Check that the member function template specialization and implicit special +// members (the default ctor) refer to their class by scope, even though they +// didn't appear in the class's member list (C_MEM). This prevents the functions +// from being added to type units, while still appearing in the type +// declaration/reference in the compile unit. +// CHECK: !DISubprogram(name: "MyClass" +// CHECK-SAME: scope: !"_ZTS7MyClass" +// CHECK: !DISubprogram(name: "add<2>" +// CHECK-SAME: scope: !"_ZTS7MyClass" diff --git a/test/CodeGenCXX/debug-info.cpp b/test/CodeGenCXX/debug-info.cpp index 29ed9e9315..394d8792fd 100644 --- a/test/CodeGenCXX/debug-info.cpp +++ b/test/CodeGenCXX/debug-info.cpp @@ -114,9 +114,6 @@ foo func(foo f) { // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "b" // CHECK-SAME: DIFlagFwdDecl -// CHECK: [[FUNC:![0-9]+]] = distinct !DISubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE" -// CHECK-SAME: type: [[FUNC_TYPE:![0-9]*]] -// CHECK-SAME: isDefinition: true } void foo() { @@ -141,6 +138,10 @@ incomplete (*x)[3]; // CHECK-SAME: baseType: !"_ZTSN6pr960810incompleteE" } +// CHECK: [[FUNC:![0-9]+]] = distinct !DISubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE" +// CHECK-SAME: type: [[FUNC_TYPE:![0-9]*]] +// CHECK-SAME: isDefinition: true + // For some reason function arguments ended up down here // CHECK: ![[F]] = !DILocalVariable(name: "f", arg: 1, scope: [[FUNC]] // CHECK-SAME: type: !"[[FOO]]" diff --git a/test/CodeGenCXX/debug-lambda-expressions.cpp b/test/CodeGenCXX/debug-lambda-expressions.cpp index a022fad1b6..3efdee54c9 100644 --- a/test/CodeGenCXX/debug-lambda-expressions.cpp +++ b/test/CodeGenCXX/debug-lambda-expressions.cpp @@ -19,18 +19,26 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int" -// A: 10 -// CHECK: ![[A_FUNC:.*]] = distinct !DISubprogram(name: "a"{{.*}}, line: [[A_LINE:[0-9]+]]{{.*}}, isDefinition: true - -// B: 14 -// CHECK: ![[B_FUNC:.*]] = distinct !DISubprogram(name: "b"{{.*}}, line: [[B_LINE:[0-9]+]]{{.*}}, isDefinition: true - -// C: 17 -// CHECK: ![[C_FUNC:.*]] = distinct !DISubprogram(name: "c"{{.*}}, line: [[C_LINE:[0-9]+]]{{.*}}, isDefinition: true +// CVAR: +// CHECK: !DIGlobalVariable(name: "cvar" +// CHECK-SAME: line: [[CVAR_LINE:[0-9]+]] +// CHECK-SAME: type: ![[CVAR_T:[0-9]+]] +// CHECK: ![[CVAR_T]] = !DICompositeType(tag: DW_TAG_class_type +// CHECK-SAME: line: [[CVAR_LINE]], +// CHECK-SAME: elements: ![[CVAR_ARGS:[0-9]+]] +// CHECK: ![[CVAR_ARGS]] = !{!{{[0-9]+}}} -// D: 18 -// CHECK: ![[D_FUNC:.*]] = distinct !DISubprogram(name: "d"{{.*}}, line: [[D_LINE:[0-9]+]]{{.*}}, isDefinition: true +// VAR: +// CHECK: !DIGlobalVariable(name: "var" +// CHECK-SAME: line: [[VAR_LINE:[0-9]+]] +// CHECK-SAME: type: ![[VAR_T:[0-9]+]] +// CHECK: ![[VAR_T]] = !DICompositeType(tag: DW_TAG_class_type +// CHECK-SAME: line: [[VAR_LINE]], +// CHECK-SAME: elements: ![[VAR_ARGS:[0-9]+]] +// CHECK: ![[VAR_ARGS]] = !{!{{[0-9]+}}} +// A: 10 +// CHECK: ![[A_FUNC:.*]] = distinct !DISubprogram(name: "a"{{.*}}, line: [[A_LINE:[0-9]+]]{{.*}}, isDefinition: true // Back to A. -- 78 // CHECK: ![[LAM_A:.*]] = !DICompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[A_FUNC]]{{.*}}, line: [[A_LINE]], @@ -41,6 +49,9 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK-SAME: line: [[A_LINE]] // CHECK-SAME: DIFlagPublic +// B: 14 +// CHECK: ![[B_FUNC:.*]] = distinct !DISubprogram(name: "b"{{.*}}, line: [[B_LINE:[0-9]+]]{{.*}}, isDefinition: true + // Back to B. -- 67 // CHECK: ![[LAM_B:.*]] = !DICompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[B_FUNC]]{{.*}}, line: [[B_LINE]], // CHECK-SAME: elements: ![[LAM_B_ARGS:[0-9]+]] @@ -54,6 +65,9 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK-SAME: line: [[B_LINE]] // CHECK-SAME: DIFlagPublic +// C: 17 +// CHECK: ![[C_FUNC:.*]] = distinct !DISubprogram(name: "c"{{.*}}, line: [[C_LINE:[0-9]+]]{{.*}}, isDefinition: true + // Back to C. -- 55 // CHECK: ![[LAM_C:.*]] = !DICompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[C_FUNC]]{{.*}}, line: [[C_LINE]], // CHECK-SAME: elements: ![[LAM_C_ARGS:[0-9]+]] @@ -68,6 +82,9 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK-SAME: line: [[C_LINE]] // CHECK-SAME: DIFlagPublic +// D: 18 +// CHECK: ![[D_FUNC:.*]] = distinct !DISubprogram(name: "d"{{.*}}, line: [[D_LINE:[0-9]+]]{{.*}}, isDefinition: true + // Back to D. -- 24 // CHECK: ![[LAM_D:.*]] = !DICompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[D_FUNC]]{{.*}}, line: [[D_LINE]], // CHECK-SAME: elements: ![[LAM_D_ARGS:[0-9]+]] @@ -82,21 +99,3 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK-SAME: scope: ![[LAM_D]] // CHECK-SAME: line: [[D_LINE]] // CHECK-SAME: DIFlagPublic - -// CVAR: -// CHECK: !DIGlobalVariable(name: "cvar" -// CHECK-SAME: line: [[CVAR_LINE:[0-9]+]] -// CHECK-SAME: type: ![[CVAR_T:[0-9]+]] -// CHECK: ![[CVAR_T]] = !DICompositeType(tag: DW_TAG_class_type -// CHECK-SAME: line: [[CVAR_LINE]], -// CHECK-SAME: elements: ![[CVAR_ARGS:[0-9]+]] -// CHECK: ![[CVAR_ARGS]] = !{!{{[0-9]+}}} - -// VAR: -// CHECK: !DIGlobalVariable(name: "var" -// CHECK-SAME: line: [[VAR_LINE:[0-9]+]] -// CHECK-SAME: type: ![[VAR_T:[0-9]+]] -// CHECK: ![[VAR_T]] = !DICompositeType(tag: DW_TAG_class_type -// CHECK-SAME: line: [[VAR_LINE]], -// CHECK-SAME: elements: ![[VAR_ARGS:[0-9]+]] -// CHECK: ![[VAR_ARGS]] = !{!{{[0-9]+}}} diff --git a/test/CodeGenCXX/debug-lambda-this.cpp b/test/CodeGenCXX/debug-lambda-this.cpp index 0c413449a3..e7ea68c1a3 100644 --- a/test/CodeGenCXX/debug-lambda-this.cpp +++ b/test/CodeGenCXX/debug-lambda-this.cpp @@ -12,10 +12,10 @@ int D::d(int x) { }(); } +// CHECK: ![[POINTER:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1D", size: 64, align: 64) // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "this", // CHECK-SAME: line: 11 -// CHECK-SAME: baseType: ![[POINTER:[0-9]+]] +// CHECK-SAME: baseType: ![[POINTER]] // CHECK-SAME: size: 64, align: 64 // CHECK-NOT: offset: 0 // CHECK-SAME: ){{$}} -// CHECK: ![[POINTER]] = !DIDerivedType(tag: DW_TAG_pointer_type diff --git a/test/CodeGenCXX/linetable-virtual-variadic.cpp b/test/CodeGenCXX/linetable-virtual-variadic.cpp index 8d1bf47814..6f96641686 100644 --- a/test/CodeGenCXX/linetable-virtual-variadic.cpp +++ b/test/CodeGenCXX/linetable-virtual-variadic.cpp @@ -15,9 +15,5 @@ void Derived::VariadicFunction(...) { } // CHECK-LABEL: define void @_ZT{{.+}}N7Derived16VariadicFunctionEz( // CHECK: ret void, !dbg ![[LOC:[0-9]+]] // -// CHECK: !llvm.dbg.cu = !{![[CU:[0-9]+]]} -// -// CHECK: ![[CU]] = distinct !DICompileUnit({{.*}} subprograms: ![[SPs:[0-9]+]] -// CHECK: ![[SPs]] = !{![[SP]]} // CHECK: ![[SP]] = distinct !DISubprogram(name: "VariadicFunction" // CHECK: ![[LOC]] = !DILocation({{.*}}scope: ![[SP]]) diff --git a/test/CodeGenObjC/debug-info-block-type.m b/test/CodeGenObjC/debug-info-block-type.m index 1f137ed9df..565bc86e8b 100644 --- a/test/CodeGenObjC/debug-info-block-type.m +++ b/test/CodeGenObjC/debug-info-block-type.m @@ -1,18 +1,17 @@ // RUN: %clang_cc1 -emit-llvm -fblocks -debug-info-kind=limited -triple x86_64-apple-darwin14 -x objective-c < %s -o - | FileCheck %s -#define nil ((void*) 0) -typedef signed char BOOL; -// CHECK: ![[BOOL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_typedef, name: "BOOL" -// CHECK-SAME: line: [[@LINE-2]] -// CHECK: ![[ID:[0-9]+]] = !DIDerivedType(tag: DW_TAG_typedef, name: "id" - -typedef BOOL (^SomeKindOfPredicate)(id obj); // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "__FuncPtr" // CHECK-SAME: baseType: ![[PTR:[0-9]+]] // CHECK: ![[PTR]] = !DIDerivedType(tag: DW_TAG_pointer_type, // CHECK-SAME: baseType: ![[FNTYPE:[0-9]+]] // CHECK: ![[FNTYPE]] = !DISubroutineType(types: ![[ARGS:[0-9]+]]) -// CHECK: ![[ARGS]] = !{![[BOOL]], ![[ID]]} +// CHECK: ![[ARGS]] = !{![[BOOL:.*]], ![[ID:.*]]} +#define nil ((void*) 0) +typedef signed char BOOL; +// CHECK: ![[BOOL]] = !DIDerivedType(tag: DW_TAG_typedef, name: "BOOL" +// CHECK-SAME: line: [[@LINE-2]] +// CHECK: ![[ID]] = !DIDerivedType(tag: DW_TAG_typedef, name: "id" +typedef BOOL (^SomeKindOfPredicate)(id obj); int main() { SomeKindOfPredicate p = ^BOOL(id obj) { return obj != nil; }; diff --git a/test/CodeGenObjC/debug-property-synth.m b/test/CodeGenObjC/debug-property-synth.m index 74ee775f75..45bf77067c 100644 --- a/test/CodeGenObjC/debug-property-synth.m +++ b/test/CodeGenObjC/debug-property-synth.m @@ -19,8 +19,8 @@ // CHECK: load {{.*}}, !dbg ![[DBG2:[0-9]+]] // // CHECK: !DISubprogram(name: "-[I p1]",{{.*}} line: [[@LINE+4]],{{.*}} isLocal: true, isDefinition: true -// CHECK: !DISubprogram(name: "-[I setP1:]",{{.*}} line: [[@LINE+3]],{{.*}} isLocal: true, isDefinition: true -// CHECK: ![[DBG1]] = !DILocation(line: [[@LINE+2]], +// CHECK: ![[DBG1]] = !DILocation(line: [[@LINE+3]], +// CHECK: !DISubprogram(name: "-[I setP1:]",{{.*}} line: [[@LINE+2]],{{.*}} isLocal: true, isDefinition: true // CHECK: ![[DBG2]] = !DILocation(line: [[@LINE+1]], @property int p1; @end diff --git a/test/Modules/ExtDebugInfo.m b/test/Modules/ExtDebugInfo.m index 5c3c7112b8..d758bfda83 100644 --- a/test/Modules/ExtDebugInfo.m +++ b/test/Modules/ExtDebugInfo.m @@ -29,17 +29,12 @@ int foo(ObjCClass *c) { return [c property]; } -// CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, -// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass", -// CHECK-SAME: scope: ![[MOD:[0-9]+]], -// CHECK-SAME: flags: DIFlagFwdDecl) -// CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, -// CHECK: ![[MOD]] = !DIModule(scope: null, name: "DebugObjC - // CHECK: !DIGlobalVariable(name: "GlobalUnion", // CHECK-SAME: type: ![[GLOBAL_UNION:[0-9]+]] +// CHECK: ![[MOD:.*]] = !DIModule(scope: null, name: "DebugObjC // CHECK: ![[GLOBAL_UNION]] = !DICompositeType(tag: DW_TAG_union_type, // CHECK-SAME: elements: !{{[0-9]+}}) + // CHECK: !DIGlobalVariable(name: "GlobalStruct", // CHECK-SAME: type: ![[GLOBAL_STRUCT:[0-9]+]] // CHECK: ![[GLOBAL_STRUCT]] = !DICompositeType(tag: DW_TAG_structure_type, @@ -49,15 +44,21 @@ int foo(ObjCClass *c) { // CHECK-SAME: baseType: ![[TD_UNION:.*]]) // CHECK: ![[TD_UNION]] = !DICompositeType(tag: DW_TAG_union_type, // CHECK-SAME: flags: DIFlagFwdDecl) + // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefEnum", // CHECK-SAME: baseType: ![[TD_ENUM:.*]]) // CHECK: ![[TD_ENUM]] = !DICompositeType(tag: DW_TAG_enumeration_type, // CHECK-SAME: flags: DIFlagFwdDecl) + // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefStruct", // CHECK-SAME: baseType: ![[TD_STRUCT:.*]]) // CHECK: ![[TD_STRUCT]] = !DICompositeType(tag: DW_TAG_structure_type, // CHECK-SAME: flags: DIFlagFwdDecl) +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass", +// CHECK-SAME: scope: ![[MOD]], +// CHECK-SAME: flags: DIFlagFwdDecl) + // CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, // CHECK-SAME: scope: ![[MOD]], diff --git a/test/Modules/ModuleDebugInfo.cpp b/test/Modules/ModuleDebugInfo.cpp index d0e304bb13..027d08637e 100644 --- a/test/Modules/ModuleDebugInfo.cpp +++ b/test/Modules/ModuleDebugInfo.cpp @@ -58,6 +58,9 @@ // CHECK-SAME: name: "Template >" // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE") +// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B", +// no mangled name here yet. + // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "FwdVirtual" // CHECK-SAME: elements: // CHECK-SAME: identifier: "_ZTS10FwdVirtual") @@ -81,9 +84,6 @@ // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation" // no mangled name here yet. -// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B", -// no mangled name here yet. - // CHECK: !DICompositeType(tag: DW_TAG_union_type, // CHECK-NOT: name: // CHECK-SAME: ) diff --git a/test/Modules/ModuleDebugInfo.m b/test/Modules/ModuleDebugInfo.m index f7fcdc1980..02ae93feb7 100644 --- a/test/Modules/ModuleDebugInfo.m +++ b/test/Modules/ModuleDebugInfo.m @@ -35,11 +35,16 @@ // CHECK-SAME: elements: // CHECK-SAME: ) -// CHECK: !DICompositeType(tag: DW_TAG_structure_type, -// CHECK-SAME: name: "FwdDecl", +// CHECK: !DISubprogram(name: "+[ObjCClass classMethod]", +// CHECK-SAME: scope: ![[MODULE]], + +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass", // CHECK-SAME: scope: ![[MODULE]], -// CHECK: !DICompositeType(tag: DW_TAG_structure_type, -// CHECK-SAME: name: "ObjCClass", + +// The forward declaration should not be in the module scope. +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OpaqueData", file + +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDecl", // CHECK-SAME: scope: ![[MODULE]], // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDeclared" @@ -70,24 +75,16 @@ // CHECK-NOT: name: // CHECK-SAME: ) -// CHECK: !DISubprogram(name: "+[ObjCClass classMethod]", -// CHECK-SAME: scope: ![[MODULE]], - -// The forward declaration should not be in the module scope. -// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OpaqueData", file - // CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl" // The output order is sublty different for module vs. pch, // so these are checked separately: // -// CHECK2: !DICompositeType(tag: DW_TAG_structure_type, -// CHECK2-SAME: name: "FwdDecl", -// CHECK2: !DICompositeType(tag: DW_TAG_structure_type, -// CHECK2-SAME: name: "ObjCClass", -// CHECK2: !DIObjCProperty(name: "property", -// CHECK2: !DIDerivedType(tag: DW_TAG_member, name: "ivar" -// CHECK2: !DIDerivedType(tag: DW_TAG_typedef, name: "InnerEnum" // CHECK2: !DISubprogram(name: "+[ObjCClass classMethod]" // CHECK2: !DISubprogram(name: "-[ObjCClass instanceMethodWithInt:]" +// CHECK2: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass", +// CHECK2: !DIObjCProperty(name: "property", +// CHECK2: !DIDerivedType(tag: DW_TAG_member, name: "ivar" // CHECK2: !DISubprogram(name: "-[Category(Category) categoryMethod]" +// CHECK2: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDecl", +// CHECK2: !DIDerivedType(tag: DW_TAG_typedef, name: "InnerEnum" -- 2.40.0