mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #66580 from adrian-prantl/110333983
Make source locations for standard library calls explicit
This commit is contained in:
@@ -6821,6 +6821,10 @@ RValue SILGenFunction::emitApplyOfLibraryIntrinsic(SILLocation loc,
|
||||
SubstitutionMap subMap,
|
||||
ArrayRef<ManagedValue> args,
|
||||
SGFContext ctx) {
|
||||
// Calls into library intrinsics are implicitly generated by the compiler.
|
||||
// Marking them as explicit creates a backtrace pointing back to the user code
|
||||
// that the intrinsic call was generated from.
|
||||
loc.markExplicit();
|
||||
auto callee = Callee::forDirect(*this, declRef, subMap, loc);
|
||||
|
||||
auto origFormalType = callee.getOrigFormalType();
|
||||
|
||||
10
test/DebugInfo/iuo_assertloc.swift
Normal file
10
test/DebugInfo/iuo_assertloc.swift
Normal file
@@ -0,0 +1,10 @@
|
||||
// RUN: %target-swift-frontend %s -emit-sil -parse-as-library -g -o - | %FileCheck %s --check-prefix=CHECK-SIL
|
||||
// RUN: %target-swift-frontend %s -emit-ir -parse-as-library -g -o - | %FileCheck %s --check-prefix=CHECK-IR
|
||||
|
||||
public func f(_ a: Int!) -> Int {
|
||||
// CHECK-IR: call {{.*}}assertionFailure{{.*}}, !dbg ![[LOC:[0-9]+]]
|
||||
// CHECK-IR: ![[LOC]] = !DILocation(line: [[@LINE+1]], column: 11
|
||||
return (a // CHECK-SIL: apply {{.*}}:[[@LINE]]:11
|
||||
+
|
||||
1)
|
||||
}
|
||||
Reference in New Issue
Block a user