From bf41881bcd7e7b1b630ad3ca2457b0fd4fa9c59e Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Wed, 22 Jan 2020 20:07:14 +0100 Subject: [PATCH] Move swift runtime failure from linkage name to function name Signed-off-by: Med Ismail Bennani --- lib/IRGen/IRGenDebugInfo.cpp | 4 ++-- test/DebugInfo/linetable-codeview.swift | 2 +- test/IRGen/condfail_message.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 2a75f47fd89a1..8cbdd8095e06d 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1847,7 +1847,7 @@ void IRGenDebugInfoImpl::setCurrentLoc(IRBuilder &Builder, auto DL = llvm::DebugLoc::get(L.Line, L.Column, Scope, InlinedAt); Builder.SetCurrentDebugLocation(DL); } - + void IRGenDebugInfoImpl::addFailureMessageToCurrentLoc(IRBuilder &Builder, StringRef failureMsg) { auto TrapLoc = Builder.getCurrentDebugLocation(); @@ -1864,7 +1864,7 @@ void IRGenDebugInfoImpl::addFailureMessageToCurrentLoc(IRBuilder &Builder, FuncName += failureMsg; llvm::DISubprogram *TrapSP = DBuilder.createFunction( - MainModule, StringRef(), FuncName, TrapLoc->getFile(), 0, DIFnTy, 0, + MainModule, FuncName, StringRef(), TrapLoc->getFile(), 0, DIFnTy, 0, llvm::DINode::FlagArtificial, llvm::DISubprogram::SPFlagDefinition, nullptr, nullptr, nullptr); diff --git a/test/DebugInfo/linetable-codeview.swift b/test/DebugInfo/linetable-codeview.swift index 524d49c8561b9..77c7141e7a1ad 100644 --- a/test/DebugInfo/linetable-codeview.swift +++ b/test/DebugInfo/linetable-codeview.swift @@ -81,7 +81,7 @@ func foo() { // FIXME: The location of ``@llvm.trap`` should be in Integers.swift.gyb // instead of being artificial. // CHECK: ![[INLINEDADD]] = !DILocation(line: 0, scope: ![[FAILURE_FUNC:[0-9]+]], inlinedAt: ![[INLINELOC:[0-9]+]] -// CHECK-DAG: !{{.*}} = distinct !DISubprogram(linkageName: "Swift runtime failure: arithmetic overflow", scope: {{.*}}, flags: DIFlagArtificial, spFlags: DISPFlagDefinition, {{.*}}) +// CHECK-DAG: !{{.*}} = distinct !DISubprogram(name: "Swift runtime failure: arithmetic overflow", scope: {{.*}}, flags: DIFlagArtificial, spFlags: DISPFlagDefinition, {{.*}}) // CHECK-DAG: ![[INLINELOC]] = !DILocation(line: 0, scope: !{{[0-9]+}}, inlinedAt: ![[ADD]] // NOTE: These prologue instructions are given artificial line locations for diff --git a/test/IRGen/condfail_message.swift b/test/IRGen/condfail_message.swift index 8c3eabb2da652..5a5fc702cf465 100644 --- a/test/IRGen/condfail_message.swift +++ b/test/IRGen/condfail_message.swift @@ -11,6 +11,6 @@ func testit(_ a: Int8) -> Int8 { // CHECK: [[CALLER_LOC:![0-9]+]] = !DILocation(line: 9, column: 12, scope: !{{.*}}) // CHECK: [[LOC]] = !DILocation(line: 0, scope: [[FAILURE_FUNC:![0-9]+]], inlinedAt: [[CALLER_LOC]]) -// CHECK: [[FAILURE_FUNC]] = distinct !DISubprogram(linkageName: "Swift runtime failure: arithmetic overflow", scope: {{.*}}, file: {{.*}}, type: [[FUNC_TYPE:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, {{.*}}) +// CHECK: [[FAILURE_FUNC]] = distinct !DISubprogram(name: "Swift runtime failure: arithmetic overflow", scope: {{.*}}, file: {{.*}}, type: [[FUNC_TYPE:![0-9]+]], flags: DIFlagArtificial, spFlags: DISPFlagDefinition, {{.*}}) // CHECK: [[FUNC_TYPE]] = !DISubroutineType(types: null)