[PATCH] D133060: [Verifier] Skip debug location check for some non-inlinable functions
Yuanfang Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 2 10:46:03 PDT 2022
ychen updated this revision to Diff 457635.
ychen added a comment.
- add comment
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133060/new/
https://reviews.llvm.org/D133060
Files:
llvm/lib/IR/Verifier.cpp
llvm/test/Verifier/callsite-dbgloc.ll
Index: llvm/test/Verifier/callsite-dbgloc.ll
===================================================================
--- llvm/test/Verifier/callsite-dbgloc.ll
+++ llvm/test/Verifier/callsite-dbgloc.ll
@@ -19,6 +19,20 @@
ret void, !dbg !10
}
+; Function Attrs: nounwind ssp uwtable
+define weak void @j() #0 !dbg !17 {
+entry:
+ call void (...) @i(), !dbg !18
+ ret void, !dbg !19
+}
+
+; Function Attrs: nounwind ssp uwtable
+define linkonce_odr void @k() #0 !dbg !20 {
+entry:
+ call void (...) @i(), !dbg !21
+ ret void, !dbg !22
+}
+
declare void @i(...) #1
; Function Attrs: nounwind ssp uwtable
@@ -27,6 +41,10 @@
; Manually removed !dbg.
; CHECK: inlinable function call in a function with debug info must have a !dbg location
call void @h()
+; CHECK-NOT: inlinable function call in a function with debug info must have a !dbg location
+ call void @j()
+; CHECK: inlinable function call in a function with debug info must have a !dbg location
+ call void @k()
ret void, !dbg !13
}
@@ -62,3 +80,9 @@
!14 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: false, unit: !0, retainedNodes: !2)
!15 = !DILocation(line: 4, column: 12, scope: !14)
!16 = !DILocation(line: 4, column: 17, scope: !14)
+!17 = distinct !DISubprogram(name: "j", scope: !1, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: false, unit: !0, retainedNodes: !2)
+!18 = !DILocation(line: 4, column: 12, scope: !17)
+!19 = !DILocation(line: 4, column: 17, scope: !17)
+!20 = distinct !DISubprogram(name: "k", scope: !1, file: !1, line: 6, type: !8, isLocal: false, isDefinition: true, scopeLine: 6, isOptimized: false, unit: !0, retainedNodes: !2)
+!21 = !DILocation(line: 4, column: 12, scope: !20)
+!22 = !DILocation(line: 4, column: 17, scope: !20)
Index: llvm/lib/IR/Verifier.cpp
===================================================================
--- llvm/lib/IR/Verifier.cpp
+++ llvm/lib/IR/Verifier.cpp
@@ -3443,8 +3443,10 @@
// Verify that each inlinable callsite of a debug-info-bearing function in a
// debug-info-bearing function has a debug location attached to it. Failure to
- // do so causes assertion failures when the inliner sets up inline scope info.
+ // do so causes assertion failures when the inliner sets up inline scope info
+ // (Interposable functions are not inlinable).
if (Call.getFunction()->getSubprogram() && Call.getCalledFunction() &&
+ !Call.getCalledFunction()->isInterposable() &&
Call.getCalledFunction()->getSubprogram())
CheckDI(Call.getDebugLoc(),
"inlinable function call in a function with "
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133060.457635.patch
Type: text/x-patch
Size: 2708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220902/673c6662/attachment.bin>
More information about the llvm-commits
mailing list