-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DebugInfo] generate btf_tag annotations for func parameters
Generate btf_tag annotations for function parameters. A field "annotations" is introduced to DILocalVariable, and annotations are represented as an DINodeArray, similar to DIComposite elements. The following example illustrates how annotations are encoded in IR: distinct !DILocalVariable(name: "info",, arg: 1, ..., annotations: !10) !10 = !{!11, !12} !11 = !{!"btf_tag", !"a"} !12 = !{!"btf_tag", !"b"} Differential Revision: https://reviews.llvm.org/D106620
- Loading branch information
1 parent
7309359
commit 1bebc31
Showing
11 changed files
with
140 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
; REQUIRES: x86-registered-target | ||
; RUN: llvm-as < %s | llvm-dis | FileCheck %s | ||
|
||
; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone uwtable willreturn | ||
define dso_local i32 @f(i32 %a) local_unnamed_addr #0 !dbg !8 { | ||
entry: | ||
call void @llvm.dbg.value(metadata i32 %a, metadata !13, metadata !DIExpression()), !dbg !17 | ||
ret i32 0, !dbg !18 | ||
} | ||
|
||
; Function Attrs: nofree nosync nounwind readnone speculatable willreturn | ||
declare void @llvm.dbg.value(metadata, metadata, metadata) #1 | ||
|
||
attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone uwtable willreturn "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } | ||
attributes #1 = { nofree nosync nounwind readnone speculatable willreturn } | ||
|
||
!llvm.dbg.cu = !{!0} | ||
!llvm.module.flags = !{!3, !4, !5, !6} | ||
!llvm.ident = !{!7} | ||
|
||
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 13.0.0 (https://github.com/llvm/llvm-project.git c9e3139e00bcef23b236a02890b909a130d1b3d9)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) | ||
!1 = !DIFile(filename: "func.c", directory: "/home/yhs/work/tests/llvm/btf_tag") | ||
!2 = !{} | ||
!3 = !{i32 7, !"Dwarf Version", i32 4} | ||
!4 = !{i32 2, !"Debug Info Version", i32 3} | ||
!5 = !{i32 1, !"wchar_size", i32 4} | ||
!6 = !{i32 7, !"uwtable", i32 1} | ||
!7 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git c9e3139e00bcef23b236a02890b909a130d1b3d9)"} | ||
!8 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !9, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12) | ||
!9 = !DISubroutineType(types: !10) | ||
!10 = !{!11, !11} | ||
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) | ||
!12 = !{!13} | ||
!13 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 1, type: !11, annotations: !14) | ||
!14 = !{!15, !16} | ||
!15 = !{!"btf_tag", !"a"} | ||
!16 = !{!"btf_tag", !"b"} | ||
|
||
; CHECK: !DILocalVariable(name: "a", arg: 1, | ||
; CHECK-SAME: annotations: ![[ANNOT:[0-9]+]] | ||
; CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]} | ||
; CHECK: ![[TAG1]] = !{!"btf_tag", !"a"} | ||
; CHECK: ![[TAG2]] = !{!"btf_tag", !"b"} | ||
|
||
!17 = !DILocation(line: 0, scope: !8) | ||
!18 = !DILocation(line: 1, column: 76, scope: !8) |
Oops, something went wrong.