@@ -20,12 +20,14 @@ LLVM pass writers, and minimal disruption to LLVM in general.
20
20
21
21
## Status and usage
22
22
23
- ** Status** : Experimental work in progress. Enabling is strongly advised against
24
- except for development and testing.
23
+ ** Status** : Enabled by default in Clang but disabled under some circumstances
24
+ (which can be overridden with the ` forced ` option, see below). ` opt ` will not
25
+ run the pass unless asked (` -passes=declare-to-assign ` ).
25
26
26
- ** Enable in Clang** : ` -Xclang -fexperimental-assignment-tracking `
27
+ ** Flag** :
28
+ ` -Xclang -fexperimental-assignment-tracking=<disabled|enabled|forced> `
27
29
28
- That causes Clang to get LLVM to run the pass ` declare-to-assign ` . The pass
30
+ When enabled Clang gets LLVM to run the pass ` declare-to-assign ` . The pass
29
31
converts conventional debug records to assignment tracking metadata and sets
30
32
the module flag ` debug-info-assignment-tracking ` to the value ` i1 true ` . To
31
33
check whether assignment tracking is enabled for a module call
@@ -88,7 +90,7 @@ int fun(int a) {
88
90
```
89
91
compiled without optimisations:
90
92
```
91
- $ clang++ test.cpp -o test.ll -emit-llvm -S -g -O0 -Xclang -fexperimental-assignment-tracking
93
+ $ clang++ test.cpp -o test.ll -emit-llvm -S -g -O0 -Xclang -fexperimental-assignment-tracking=enabled
92
94
```
93
95
we get:
94
96
```
@@ -194,8 +196,7 @@ the choice at each instruction, iteratively joining the results for each block.
194
196
195
197
### TODO list
196
198
197
- As this is an experimental work in progress so there are some items we still need
198
- to tackle:
199
+ Outstanding improvements:
199
200
200
201
* As mentioned in test llvm/test/DebugInfo/assignment-tracking/X86/diamond-3.ll,
201
202
the analysis should treat escaping calls like untagged stores.
@@ -228,3 +229,8 @@ to tackle:
228
229
that we can only track assignments with fixed offsets and sizes, I think we
229
230
can probably get rid of the address and address-expression part, since it
230
231
will always be computable with the info we have.
232
+
233
+ * Assignment tracking is disabled by default for LTO and thinLTO builds, and
234
+ if LLDB debugger tuning has been specified. We should remove these
235
+ restrictions. See EmitAssemblyHelper::RunOptimizationPipeline in
236
+ clang/lib/CodeGen/BackendUtil.cpp.
0 commit comments