r252220 - CodeGen: Update for debug info API change.

Peter Collingbourne via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 14:04:15 PST 2015


Author: pcc
Date: Thu Nov  5 16:04:14 2015
New Revision: 252220

URL: http://llvm.org/viewvc/llvm-project?rev=252220&view=rev
Log:
CodeGen: Update for debug info API change.

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

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGen/debug-info-block-decl.c
    cfe/trunk/test/CodeGenCXX/debug-info-static-fns.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-windows-dtor.cpp
    cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp
    cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp
    cfe/trunk/test/CodeGenObjCXX/property-objects.mm

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=252220&r1=252219&r2=252220&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Nov  5 16:04:14 2015
@@ -1183,7 +1183,7 @@ llvm::DISubprogram *CGDebugInfo::CreateC
       RecordTy, MethodName, MethodLinkageName, MethodDefUnit, MethodLine,
       MethodTy, /*isLocalToUnit=*/false,
       /* isDefinition=*/false, Virtuality, VIndex, ContainingType, Flags,
-      CGM.getLangOpts().Optimize, nullptr, TParamsArray.get());
+      CGM.getLangOpts().Optimize, TParamsArray.get());
 
   SPCache[Method->getCanonicalDecl()].reset(SP);
 
@@ -2486,7 +2486,7 @@ CGDebugInfo::getFunctionForwardDeclarati
   llvm::DISubprogram *SP = DBuilder.createTempFunctionFwdDecl(
       DContext, Name, LinkageName, Unit, Line,
       getOrCreateFunctionType(FD, FnType, Unit), !FD->isExternallyVisible(),
-      /* isDefinition = */ false, 0, Flags, CGM.getLangOpts().Optimize, nullptr,
+      /* isDefinition = */ false, 0, Flags, CGM.getLangOpts().Optimize,
       TParamsArray.get(), getFunctionDeclaration(FD));
   const FunctionDecl *CanonDecl = cast<FunctionDecl>(FD->getCanonicalDecl());
   FwdDeclReplaceMap.emplace_back(std::piecewise_construct,
@@ -2699,8 +2699,9 @@ void CGDebugInfo::EmitFunctionStart(Glob
   llvm::DISubprogram *SP = DBuilder.createFunction(
       FDContext, Name, LinkageName, Unit, LineNo,
       getOrCreateFunctionType(D, FnType, Unit), Fn->hasInternalLinkage(),
-      true /*definition*/, ScopeLine, Flags, CGM.getLangOpts().Optimize, Fn,
+      true /*definition*/, ScopeLine, Flags, CGM.getLangOpts().Optimize,
       TParamsArray.get(), getFunctionDeclaration(D));
+  Fn->setSubprogram(SP);
   // We might get here with a VarDecl in the case we're generating
   // code for the initialization of globals. Do not record these decls
   // as they will overwrite the actual VarDecl Decl in the cache.
@@ -2752,9 +2753,8 @@ void CGDebugInfo::EmitFunctionDecl(Globa
   DBuilder.createFunction(FDContext, Name, LinkageName, Unit, LineNo,
                           getOrCreateFunctionType(D, FnType, Unit),
                           false /*internalLinkage*/, true /*definition*/,
-                          ScopeLine, Flags, CGM.getLangOpts().Optimize, nullptr,
-                          TParamsArray.get(),
-                          getFunctionDeclaration(D));
+                          ScopeLine, Flags, CGM.getLangOpts().Optimize,
+                          TParamsArray.get(), getFunctionDeclaration(D));
 }
 
 void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc) {

Modified: cfe/trunk/test/CodeGen/debug-info-block-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-block-decl.c?rev=252220&r1=252219&r2=252220&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info-block-decl.c (original)
+++ cfe/trunk/test/CodeGen/debug-info-block-decl.c Thu Nov  5 16:04:14 2015
@@ -5,7 +5,7 @@
 // CHECK: define{{.*}}@main()
 // CHECK: store{{.*}}bitcast{{.*}}, !dbg ![[ASSIGNMENT:[0-9]+]]
 // CHECK: define {{.*}} @__main_block_invoke
-// CHECK: dbg ![[BLOCK_ENTRY:[0-9]+]]
+// CHECK: , !dbg ![[BLOCK_ENTRY:[0-9]+]]
 
 int main()
 {

Modified: cfe/trunk/test/CodeGenCXX/debug-info-static-fns.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-static-fns.cpp?rev=252220&r1=252219&r2=252220&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-static-fns.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-static-fns.cpp Thu Nov  5 16:04:14 2015
@@ -7,7 +7,7 @@ namespace A {
 }
 
 // Verify that a is present and mangled.
-// CHECK: !DISubprogram(name: "a", linkageName: "_ZN1AL1aEi",
+// CHECK: define internal i32 @_ZN1AL1aEi({{.*}} !dbg [[DBG:![0-9]+]]
+// CHECK: [[DBG]] = distinct !DISubprogram(name: "a", linkageName: "_ZN1AL1aEi",
 // CHECK-SAME:          line: 4
 // CHECK-SAME:          isDefinition: true
-// CHECK-SAME:          function: i32 (i32)* @_ZN1AL1aEi

Modified: cfe/trunk/test/CodeGenCXX/debug-info-windows-dtor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-windows-dtor.cpp?rev=252220&r1=252219&r2=252220&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-windows-dtor.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-windows-dtor.cpp Thu Nov  5 16:04:14 2015
@@ -14,9 +14,9 @@ struct AB: A, B {
 
 template struct AB<int>;
 
-// CHECK-LABEL: define {{.*}}@"\01??_E?$AB at H@@W3AEPAXI at Z"
+// CHECK: define {{.*}}@"\01??_E?$AB at H@@W3AEPAXI at Z"({{.*}} !dbg [[THUNK_VEC_DEL_DTOR:![0-9]*]]
 // CHECK: call {{.*}}@"\01??_G?$AB at H@@UAEPAXI at Z"({{.*}}) #{{[0-9]*}}, !dbg [[THUNK_LOC:![0-9]*]]
-// CHECK-LABEL: define
+// CHECK: define
 
-// CHECK: [[THUNK_VEC_DEL_DTOR:![0-9]*]] = distinct !DISubprogram({{.*}}function: {{.*}}@"\01??_E?$AB at H@@W3AEPAXI at Z"
+// CHECK: [[THUNK_VEC_DEL_DTOR]] = distinct !DISubprogram
 // CHECK: [[THUNK_LOC]] = !DILocation(line: 15, scope: [[THUNK_VEC_DEL_DTOR]])

Modified: cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp?rev=252220&r1=252219&r2=252220&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp Thu Nov  5 16:04:14 2015
@@ -4,7 +4,7 @@
 // Verify that the global init helper function does not get associated
 // with any source location.
 //
-// CHECK: define internal {{.*}}void @_GLOBAL__sub_I_globalinit_loc.cpp
+// CHECK: define internal {{.*}}void @_GLOBAL__sub_I_globalinit_loc.cpp({{.*}} {
 // CHECK: !dbg ![[DBG:.*]]
 // CHECK: !DISubprogram(linkageName: "_GLOBAL__sub_I_globalinit_loc.cpp"
 // CHECK-NOT:           line:

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=252220&r1=252219&r2=252220&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp Thu Nov  5 16:04:14 2015
@@ -10,7 +10,7 @@ class Derived : public virtual Base {
 
 void Derived::VariadicFunction(...) { }
 
-// CHECK-LABEL: define void @_ZN7Derived16VariadicFunctionEz(
+// CHECK: define void @_ZN7Derived16VariadicFunctionEz({{.*}} !dbg ![[SP:[0-9]+]]
 // CHECK: ret void, !dbg ![[LOC:[0-9]+]]
 // CHECK-LABEL: define void @_ZT{{.+}}N7Derived16VariadicFunctionEz(
 // CHECK: ret void, !dbg ![[LOC:[0-9]+]]
@@ -18,6 +18,6 @@ void Derived::VariadicFunction(...) { }
 // CHECK: !llvm.dbg.cu = !{![[CU:[0-9]+]]}
 //
 // CHECK: ![[CU]] = distinct !DICompileUnit({{.*}} subprograms: ![[SPs:[0-9]+]]
-// CHECK: ![[SPs]] = !{![[SP:[0-9]+]]}
-// CHECK: ![[SP]] = distinct !DISubprogram(name: "VariadicFunction",{{.*}} function: {{[^:]+}} @_ZN7Derived16VariadicFunctionEz
+// CHECK: ![[SPs]] = !{![[SP]]}
+// CHECK: ![[SP]] = distinct !DISubprogram(name: "VariadicFunction"
 // CHECK: ![[LOC]] = !DILocation({{.*}}scope: ![[SP]])

Modified: cfe/trunk/test/CodeGenObjCXX/property-objects.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/property-objects.mm?rev=252220&r1=252219&r2=252220&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/property-objects.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/property-objects.mm Thu Nov  5 16:04:14 2015
@@ -37,7 +37,7 @@ struct CGRect {
 
 // Don't attach debug locations to the prologue instructions. These were
 // leaking over from the previous function emission by accident.
-// CHECK: define internal void @"\01-[I setBounds:]"
+// CHECK: define internal void @"\01-[I setBounds:]"({{.*}} {
 // CHECK-NOT: !dbg
 // CHECK: call void @llvm.dbg.declare
 - (void)setFrame:(CGRect)frameRect {}




More information about the cfe-commits mailing list