]> granicus.if.org Git - clang/commitdiff
CodeGen: Update for debug info API change.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 5 Nov 2015 22:04:14 +0000 (22:04 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 5 Nov 2015 22:04:14 +0000 (22:04 +0000)
Differential Revision: http://reviews.llvm.org/D14266

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

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

index 7efd1ecba9a3f415511ed5740a60beb9097ab413..30a184cf638fdf3375715f1f77591cd968c276d3 100644 (file)
@@ -1183,7 +1183,7 @@ llvm::DISubprogram *CGDebugInfo::CreateCXXMemberFunction(
       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::getFunctionForwardDeclaration(const FunctionDecl *FD) {
   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(GlobalDecl GD, SourceLocation Loc,
   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(GlobalDecl GD, SourceLocation Loc,
   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) {
index 334e026a8b5a62be97083e9eaf455374029da6da..e45a2d8ad474d75b1b0b72eb0063f76804283dd2 100644 (file)
@@ -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()
 {
index 718187e368ba6119635b56f26a30a907ee6f62f9..59c7471f7ca6a07679f3631285088bc8d35827fb 100644 (file)
@@ -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
index 79059fedf0365a8ae2276d46fd574bba896b9b95..e5a51abae68b97843559952f05022d46842d21cc 100644 (file)
@@ -14,9 +14,9 @@ struct AB: A, B {
 
 template struct AB<int>;
 
-// CHECK-LABEL: define {{.*}}@"\01??_E?$AB@H@@W3AEPAXI@Z"
+// CHECK: define {{.*}}@"\01??_E?$AB@H@@W3AEPAXI@Z"({{.*}} !dbg [[THUNK_VEC_DEL_DTOR:![0-9]*]]
 // CHECK: call {{.*}}@"\01??_G?$AB@H@@UAEPAXI@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@H@@W3AEPAXI@Z"
+// CHECK: [[THUNK_VEC_DEL_DTOR]] = distinct !DISubprogram
 // CHECK: [[THUNK_LOC]] = !DILocation(line: 15, scope: [[THUNK_VEC_DEL_DTOR]])
index babcf3f6cb6f8290d35aafe28549d6c3137d4690..203eb2142667fdc4a045d87a2d38783126f7f3a1 100644 (file)
@@ -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:
index 4a0772a271ca7e1b374045d8866be373179f67e4..8d1bf47814f86dcc4c13dbfae2d10690a1b3e423 100644 (file)
@@ -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]])
index f2ffb0ae52d0bd976dee6246e8b57e7e03a5669d..8e0b6aebe1494b01b55c70f1ed0c07b9c1cdad57 100644 (file)
@@ -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 {}