[PATCH] D58034: [IR/DIVar] Add flag for params that have unchanged values
Djordje Todorovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 13 02:40:37 PST 2019
djtodoro updated this revision to Diff 186609.
djtodoro added a comment.
- Rename: `VariableNotChanged `===> `ArgumentNotModified`
- Add test case in test/Assembler/debug-info.ll
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58034/new/
https://reviews.llvm.org/D58034
Files:
bindings/go/llvm/dibuilder.go
include/llvm/IR/DebugInfoFlags.def
include/llvm/IR/DebugInfoMetadata.h
test/Assembler/debug-info.ll
Index: test/Assembler/debug-info.ll
===================================================================
--- test/Assembler/debug-info.ll
+++ test/Assembler/debug-info.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
; RUN: verify-uselistorder %s
-; CHECK: !named = !{!0, !0, !1, !2, !3, !4, !5, !6, !7, !8, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42}
+; CHECK: !named = !{!0, !0, !1, !2, !3, !4, !5, !6, !7, !8, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42, !43, !44}
; CHECK: !0 = !DISubrange(count: 3)
; CHECK-NEXT: !1 = !DISubrange(count: 3, lowerBound: 4)
@@ -99,3 +99,8 @@
; CHECK-NEXT: !39 = !DIBasicType(name: "u64.le", size: 64, align: 1, encoding: DW_ATE_unsigned, flags: DIFlagLittleEndian)
!41 = !DIBasicType(name: "u64.be", size: 64, align: 1, encoding: DW_ATE_unsigned, flags: DIFlagBigEndian)
!42 = !DIBasicType(name: "u64.le", size: 64, align: 1, encoding: DW_ATE_unsigned, flags: DIFlagLittleEndian)
+
+; CHECK-NEXT: !40 = distinct !DISubprogram(name: "fn", scope: {{.*}}, file: {{.*}}, spFlags: 0)
+; CHECK-NEXT: !41 = !DILocalVariable(name: "Name", arg: 1, scope: {{.*}}, file: {{.*}}, line: 13, type: {{.*}}, flags: DIFlagArgumentNotModified)
+!43 = distinct !DISubprogram(name: "fn", scope: !12, file: !12, spFlags: 0)
+!44 = !DILocalVariable(name: "Name", arg: 1, scope: !43, file: !12, line: 13, type: !7, flags: DIFlagArgumentNotModified)
Index: include/llvm/IR/DebugInfoMetadata.h
===================================================================
--- include/llvm/IR/DebugInfoMetadata.h
+++ include/llvm/IR/DebugInfoMetadata.h
@@ -2880,6 +2880,9 @@
bool isArtificial() const { return getFlags() & FlagArtificial; }
bool isObjectPointer() const { return getFlags() & FlagObjectPointer; }
+ /// Check that an argument is unmodified.
+ bool isNotModified() const { return getFlags() & FlagArgumentNotModified; }
+
/// Check that a location is valid for this variable.
///
/// Check that \c DL exists, is in the same subprogram, and has the same
Index: include/llvm/IR/DebugInfoFlags.def
===================================================================
--- include/llvm/IR/DebugInfoFlags.def
+++ include/llvm/IR/DebugInfoFlags.def
@@ -59,6 +59,7 @@
HANDLE_DI_FLAG((1 << 27), BigEndian)
HANDLE_DI_FLAG((1 << 28), LittleEndian)
HANDLE_DI_FLAG((1 << 29), AllCallsDescribed)
+HANDLE_DI_FLAG((1 << 30), ArgumentNotModified)
// To avoid needing a dedicated value for IndirectVirtualBase, we use
// the bitwise or of Virtual and FwdDecl, which does not otherwise
@@ -68,7 +69,7 @@
#ifdef DI_FLAG_LARGEST_NEEDED
// intended to be used with ADT/BitmaskEnum.h
// NOTE: always must be equal to largest flag, check this when adding new flag
-HANDLE_DI_FLAG((1 << 29), Largest)
+HANDLE_DI_FLAG((1 << 30), Largest)
#undef DI_FLAG_LARGEST_NEEDED
#endif
Index: bindings/go/llvm/dibuilder.go
===================================================================
--- bindings/go/llvm/dibuilder.go
+++ bindings/go/llvm/dibuilder.go
@@ -54,6 +54,7 @@
FlagVector
FlagStaticMember
FlagIndirectVariable
+ FlagArgumentNotModified
)
type DwarfLang uint32
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58034.186609.patch
Type: text/x-patch
Size: 3829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190213/a8aa8042/attachment.bin>
More information about the llvm-commits
mailing list