@@ -389,12 +389,12 @@ Compiled to LLVM, this function would be represented like this:
389
389
%X = alloca i32, align 4
390
390
%Y = alloca i32, align 4
391
391
%Z = alloca i32, align 4
392
- #dbg_declare(ptr %X, !11, !DIExpression(), !14 )
393
- store i32 21, i32* %X, align 4, !dbg !14
394
- #dbg_declare(ptr %Y, !15 , !DIExpression(), !16 )
395
- store i32 22, i32* %Y, align 4, !dbg !16
396
- #dbg_declare(ptr %Z, !17 , !DIExpression(), !19 )
397
- store i32 23, i32* %Z, align 4, !dbg !19
392
+ #dbg_declare(ptr %X, !11, !DIExpression(), !13 )
393
+ store i32 21, i32* %X, align 4, !dbg !13
394
+ #dbg_declare(ptr %Y, !14 , !DIExpression(), !15 )
395
+ store i32 22, i32* %Y, align 4, !dbg !15
396
+ #dbg_declare(ptr %Z, !16 , !DIExpression(), !18 )
397
+ store i32 23, i32* %Z, align 4, !dbg !18
398
398
%0 = load i32, i32* %X, align 4, !dbg !20
399
399
store i32 %0, i32* %Z, align 4, !dbg !21
400
400
%1 = load i32, i32* %Y, align 4, !dbg !22
@@ -427,9 +427,9 @@ Compiled to LLVM, this function would be represented like this:
427
427
!15 = !DILocation(line: 3, column: 9, scope: !4)
428
428
!16 = !DILocalVariable(name: "Z", scope: !18, file: !1, line: 5, type: !12)
429
429
!17 = distinct !DILexicalBlock(scope: !4, file: !1, line: 4, column: 5)
430
- !18 = !DILocation(line: 5, column: 11, scope: !18 )
431
- !29 = !DILocation(line: 6, column: 11, scope: !18 )
432
- !20 = !DILocation(line: 6, column: 9, scope: !18 )
430
+ !18 = !DILocation(line: 5, column: 11, scope: !17 )
431
+ !29 = !DILocation(line: 6, column: 11, scope: !17 )
432
+ !20 = !DILocation(line: 6, column: 9, scope: !17 )
433
433
!21 = !DILocation(line: 8, column: 9, scope: !4)
434
434
!22 = !DILocation(line: 8, column: 7, scope: !4)
435
435
!23 = !DILocation(line: 9, column: 3, scope: !4)
@@ -443,21 +443,21 @@ variable definitions, and the code used to implement the function.
443
443
444
444
.. code-block :: llvm
445
445
446
- #dbg_declare(ptr %X, !11, !DIExpression(), !14 )
447
- ; [debug line = 2:7 ] [debug variable = X]
446
+ #dbg_declare(ptr %X, !11, !DIExpression(), !13 )
447
+ ; [debug line = 2:9 ] [debug variable = X]
448
448
449
449
The first record ``#dbg_declare `` encodes debugging information for the
450
- variable ``X ``. The location ``!14 `` at the end of the record provides
450
+ variable ``X ``. The location ``!13 `` at the end of the record provides
451
451
scope information for the variable ``X ``.
452
452
453
453
.. code-block :: text
454
454
455
- !14 = !DILocation(line: 2, column: 9, scope: !4)
455
+ !13 = !DILocation(line: 2, column: 9, scope: !4)
456
456
!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5,
457
457
isLocal: false, isDefinition: true, scopeLine: 1,
458
458
isOptimized: false, retainedNodes: !2)
459
459
460
- Here ``!14 `` is metadata providing `location information
460
+ Here ``!13 `` is metadata providing `location information
461
461
<LangRef.html#dilocation> `_. In this example, scope is encoded by ``!4 ``, a
462
462
`subprogram descriptor <LangRef.html#disubprogram >`_. This way the location
463
463
information parameter to the records indicates that the variable ``X `` is
@@ -467,20 +467,20 @@ Now lets take another example.
467
467
468
468
.. code-block :: llvm
469
469
470
- #dbg_declare(ptr %Z, !17 , !DIExpression(), !19 )
471
- ; [debug line = 5:9 ] [debug variable = Z]
470
+ #dbg_declare(ptr %Z, !16 , !DIExpression(), !18 )
471
+ ; [debug line = 5:11 ] [debug variable = Z]
472
472
473
473
The third record ``#dbg_declare `` encodes debugging information for
474
- variable ``Z ``. The metadata ``!19 `` at the end of the record provides
474
+ variable ``Z ``. The metadata ``!18 `` at the end of the record provides
475
475
scope information for the variable ``Z ``.
476
476
477
477
.. code-block :: text
478
478
479
- !18 = distinct !DILexicalBlock(scope: !4, file: !1, line: 4, column: 5)
480
- !19 = !DILocation(line: 5, column: 11, scope: !18 )
479
+ !17 = distinct !DILexicalBlock(scope: !4, file: !1, line: 4, column: 5)
480
+ !18 = !DILocation(line: 5, column: 11, scope: !17 )
481
481
482
- Here ``!19 `` indicates that ``Z `` is declared at line number 5 and column
483
- number 11 inside of lexical scope ``!18 ``. The lexical scope itself resides
482
+ Here ``!18 `` indicates that ``Z `` is declared at line number 5 and column
483
+ number 11 inside of lexical scope ``!17 ``. The lexical scope itself resides
484
484
inside of subprogram ``!4 `` described above.
485
485
486
486
The scope information attached with each instruction provides a straightforward
0 commit comments