r266445 - Update to match LLVM changes for PR27284.

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 15 08:55:45 PDT 2016


Author: adrian
Date: Fri Apr 15 10:55:45 2016
New Revision: 266445

URL: http://llvm.org/viewvc/llvm-project?rev=266445&view=rev
Log:
Update to match LLVM changes for PR27284.
(Reverse the ownership between DICompileUnit and DISubprogram.)

http://reviews.llvm.org/D19034
<rdar://problem/25256815>

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGen/debug-info-scope-file.c
    cfe/trunk/test/CodeGen/debug-info.c
    cfe/trunk/test/CodeGenCXX/PR20038.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-function-context.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp
    cfe/trunk/test/CodeGenCXX/debug-info.cpp
    cfe/trunk/test/CodeGenCXX/debug-lambda-expressions.cpp
    cfe/trunk/test/CodeGenCXX/debug-lambda-this.cpp
    cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp
    cfe/trunk/test/CodeGenObjC/debug-info-block-type.m
    cfe/trunk/test/CodeGenObjC/debug-property-synth.m
    cfe/trunk/test/Modules/ExtDebugInfo.m
    cfe/trunk/test/Modules/ModuleDebugInfo.cpp
    cfe/trunk/test/Modules/ModuleDebugInfo.m

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 15 10:55:45 2016
@@ -2793,11 +2793,11 @@ void CGDebugInfo::EmitFunctionDecl(Globa
   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) {

Modified: cfe/trunk/test/CodeGen/debug-info-scope-file.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-scope-file.c?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info-scope-file.c (original)
+++ cfe/trunk/test/CodeGen/debug-info-scope-file.c Fri Apr 15 10:55:45 2016
@@ -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() {

Modified: cfe/trunk/test/CodeGen/debug-info.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info.c?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info.c (original)
+++ cfe/trunk/test/CodeGen/debug-info.c Fri Apr 15 10:55:45 2016
@@ -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];

Modified: cfe/trunk/test/CodeGenCXX/PR20038.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/PR20038.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/PR20038.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/PR20038.cpp Fri Apr 15 10:55:45 2016
@@ -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; }

Modified: cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp Fri Apr 15 10:55:45 2016
@@ -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

Modified: cfe/trunk/test/CodeGenCXX/debug-info-function-context.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-function-context.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-function-context.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-function-context.cpp Fri Apr 15 10:55:45 2016
@@ -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

Modified: cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp Fri Apr 15 10:55:45 2016
@@ -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(

Modified: cfe/trunk/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp Fri Apr 15 10:55:45 2016
@@ -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

Modified: cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp Fri Apr 15 10:55:45 2016
@@ -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<typename T>
 struct outer {
@@ -98,3 +89,13 @@ inline void f1() {
 void f2() {
   virt<elem> d; // emit 'virt<elem>'
 }
+
+// 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"

Modified: cfe/trunk/test/CodeGenCXX/debug-info.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info.cpp Fri Apr 15 10:55:45 2016
@@ -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]]"

Modified: cfe/trunk/test/CodeGenCXX/debug-lambda-expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-lambda-expressions.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-lambda-expressions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-lambda-expressions.cpp Fri Apr 15 10:55:45 2016
@@ -19,18 +19,26 @@ int d(int x) { D y[10]; return [x,y] { r
 
 // 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] { r
 // 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] { r
 // 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] { r
 // 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] { r
 // 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]+}}}

Modified: cfe/trunk/test/CodeGenCXX/debug-lambda-this.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-lambda-this.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-lambda-this.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-lambda-this.cpp Fri Apr 15 10:55:45 2016
@@ -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

Modified: cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp Fri Apr 15 10:55:45 2016
@@ -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]])

Modified: cfe/trunk/test/CodeGenObjC/debug-info-block-type.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-block-type.m?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info-block-type.m (original)
+++ cfe/trunk/test/CodeGenObjC/debug-info-block-type.m Fri Apr 15 10:55:45 2016
@@ -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; };

Modified: cfe/trunk/test/CodeGenObjC/debug-property-synth.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-property-synth.m?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-property-synth.m (original)
+++ cfe/trunk/test/CodeGenObjC/debug-property-synth.m Fri Apr 15 10:55:45 2016
@@ -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

Modified: cfe/trunk/test/Modules/ExtDebugInfo.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ExtDebugInfo.m?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/Modules/ExtDebugInfo.m (original)
+++ cfe/trunk/test/Modules/ExtDebugInfo.m Fri Apr 15 10:55:45 2016
@@ -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]],

Modified: cfe/trunk/test/Modules/ModuleDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ModuleDebugInfo.cpp?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/Modules/ModuleDebugInfo.cpp (original)
+++ cfe/trunk/test/Modules/ModuleDebugInfo.cpp Fri Apr 15 10:55:45 2016
@@ -58,6 +58,9 @@
 // CHECK-SAME:             name: "Template<float, DebugCXX::traits<float> >"
 // 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:             )

Modified: cfe/trunk/test/Modules/ModuleDebugInfo.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ModuleDebugInfo.m?rev=266445&r1=266444&r2=266445&view=diff
==============================================================================
--- cfe/trunk/test/Modules/ModuleDebugInfo.m (original)
+++ cfe/trunk/test/Modules/ModuleDebugInfo.m Fri Apr 15 10:55:45 2016
@@ -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"




More information about the cfe-commits mailing list