summaryrefslogtreecommitdiffstats
diff options
authorCary Coutant <ccoutant@gmail.com>2025-05-16 16:19:02 -0700
committerCary Coutant <ccoutant@gmail.com>2025-05-16 16:19:02 -0700
commitda89634d117e64baed248c83e940193afed75d08 (patch)
tree75662de5eb943b0860559a3ab62738823696a697
parentNew issue 250516.1 (reopened 090107.2). (diff)
Update 250407.1.
-rw-r--r--md/issues/250407.1.md29
1 files changed, 18 insertions, 11 deletions
diff --git a/md/issues/250407.1.md b/md/issues/250407.1.md
index c0841fd..3958b12 100644
--- a/md/issues/250407.1.md
+++ b/md/issues/250407.1.md
@@ -3,14 +3,14 @@ Author: Jann Horn
3Email: jannh@google.com 3Email: jannh@google.com
4Champion: David Blaikie 4Champion: David Blaikie
5Submit-Date: 2025-04-07 5Submit-Date: 2025-04-07
6Revised-Date: 6Revised-Date: 2025-05-13
7Closed-Date: 7Closed-Date:
8Propid: 250407.1 8Propid: 250407.1
9Type: Enhancement 9Type: Enhancement
10Status: Open 10Status: Open
11Version: 6 11Version: 6
12Format: markdown 12Format: markdown
13Revisions: 13Revisions: 2025-04-14
14 14
15## Background 15## Background
16 16
@@ -68,7 +68,7 @@ calls to the allocator subroutine.
68 68
69## Overview 69## Overview
70 70
71I am proposing to add a new DWARF attribute `DW_AT_heapallocsite` that 71Add a new DWARF attribute `DW_AT_alloc_type` that
72can be attached to a `DW_TAG_call_site` (or `DW_TAG_inlined_subroutine`) 72can be attached to a `DW_TAG_call_site` (or `DW_TAG_inlined_subroutine`)
73for calls to allocator subroutines (or subroutines with similar 73for calls to allocator subroutines (or subroutines with similar
74semantics). The value of the attribute is essentially the type 74semantics). The value of the attribute is essentially the type
@@ -79,31 +79,28 @@ allocated by the callee when called from the callsite.
79In section "2.2 Attribute Types", Table 2.2 "Attribute names", add the 79In section "2.2 Attribute Types", Table 2.2 "Attribute names", add the
80following entry: 80following entry:
81 81
82Attribute: `DW_AT_heapallocsite` 82Attribute: `DW_AT_alloc_type`
83Identifies or Specifies: Type allocated at call site 83Identifies or Specifies: Type allocated at call site
84 84
85In section "7.5.4 Attribute Encodings", Table 7.5 "Attribute 85In section "7.5.4 Attribute Encodings", Table 7.5 "Attribute
86encodings", add the following entry: 86encodings", add the following entry:
87 87
88Attribute name: `DW_AT_heapallocsite` 88Attribute name: `DW_AT_alloc_type`
89Value: `<next available ID>` 89Value: `<next available ID>`
90Classes: reference 90Classes: reference
91 91
92At the end of section "3.4.1 Call Site Entries", append these paragraphs: 92At the end of section "3.4.1 Call Site Entries", append these paragraphs:
93 93
94> The call site may have a `DW_AT_heapallocsite` attribute referencing a 94> The call site may have a `DW_AT_alloc_type` attribute referencing a
95> debugging information entry for the type that the type-agnostic callee 95> debugging information entry for the type that the type-agnostic callee
96> operates on when called from this call site. In particular, if the 96> operates on when called from this call site. In particular, if the
97> callee's primary purpose is to allocate memory, it refers to the type 97> callee's primary purpose is to allocate memory, it refers to the type
98> of the allocated object. The referenced type may be a reasonable guess 98> of the allocated object. The referenced type may be a reasonable guess
99> if no reliable type information is available. 99> if no reliable type information is available.
100> 100>
101> *This attribute should only be used when either the callee is a 101> *This attribute should only be used when either the callee is a
102> memory allocation subroutine or the programmer has requested its use 102> memory allocation subroutine or the programmer has requested its use
103> at a specific call site or for calls to a specific subroutine. The 103> at a specific call site or for calls to a specific subroutine.*
104> meaning of this attribute, when attached to a subroutine whose primary
105> purpose is not to allocate memory, is defined by the
106> programmer.*
107 104
108In section "3.3.8.2 Concrete Instances", before the paragraph starting 105In section "3.3.8.2 Concrete Instances", before the paragraph starting
109with "An inlined subroutine entry may have a `DW_AT_const_expr` 106with "An inlined subroutine entry may have a `DW_AT_const_expr`
@@ -132,3 +129,13 @@ S_HEAPALLOCSITE debuginfo][3]
132[1]: https://clang.llvm.org/docs/AttributeReference.html#allocator 129[1]: https://clang.llvm.org/docs/AttributeReference.html#allocator
133[2]: https://github.com/llvm/llvm-project/pull/132073 130[2]: https://github.com/llvm/llvm-project/pull/132073
134[3]: https://learn.microsoft.com/en-us/visualstudio/profiling/memory-usage?view=vs-2022 131[3]: https://learn.microsoft.com/en-us/visualstudio/profiling/memory-usage?view=vs-2022
132
133---
134
1352025-05-13: [Revised][diff1].
136Change name to `DW_AT_alloc_type`.
137Remove sentence about non-memory-allocating usage:
138
139> <del>The meaning of this attribute, when attached to a
140> subroutine whose primary purpose is not to allocate
141> memory, is defined by the programmer.</del>