<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Making debug info assembly readable and writable<br>
==============================<u></u>==================<br>
<br>
Moreover, we're now in a place where it's trivial to express the<br>
"context" pointer structurally. Here's the same debug info as above,<br>
using syntactic sugar to fill the "context" pointers:<br>
<br>
!0 = metadata DIFile(filename: "foo.cpp", directory: "/path/to")<br>
!1 = metadata DIFile(filename: "./t.h", directory: "/path/to")<br>
!2 = metadata DIFile(filename: "bar.cpp", directory: "/path/to")<br>
!3 = metadata DIBaseType(name: "short", size: 16, align: 16)<br>
!5 = metadata DIBaseType(name: "int", size: 32, align: 32)<br>
!6 = metadata DICompositeType(tag: 0x13, name: "T", uniqued: "_ZTS1T",<br>
file: !1, line: 1, size: 32, align: 16) {<br>
!7 = metadata DIMember(line: 1, file: !1, type: !3,<br>
name: "a", size: 16, align: 16)<br>
!8 = metadata DIMember(line: 1, file: !1, type: !3,<br>
name: "b", size: 16, align: 16)<br>
} ; !6<br>
!9 = metadata DISubroutineType(args: [ !5, !6 ])<br>
!10 = metadata DICompileUnit(file: !0, language: 4, kind: FullDebug,<br>
producer: "clang version 3.6.0 ",<br>
retainedUniqueTypes: [ !6 ]) {<br>
!11 = metadata DISubprogram(name: "foo", linkageName: "_Z3foo1T",<br>
handle: i32(i32)* @_Z3foo1T, file: !0,<br>
type: !9) {<br>
!12 = metadata DIArgVariable(name: "t", arg: 1, line: 2, type: !6)<br>
!13 = metadata DILocation(line: 2, column: 11)<br>
!14 = metadata DILocation(line: 2, column: 16)<br>
} ; !11<br>
} ; !10<br>
!15 = metadata DICompileUnit(file: !2, language: 4, kind: FullDebug,<br>
producer: "clang version 3.6.0 ",<br>
retainedUniqueTypes: [ !6 ]) {<br>
!16 = metadata DISubprogram(name: "bar", linkageName: "_Z3bar1T",<br>
handle: i32 (i32)* @_Z3bar1T, file: !2,<br>
type: !9) {<br>
!17 = metadata DIArgVariable(name: "t", arg: 2, line: 3, type: !6)<br>
!18 = metadata DILocation(line: 3, column: 11)<br>
!19 = metadata DILocation(line: 3, column: 23)<br>
} ; !16<br>
} ; !15<br>
<br>
This assembly has the following advantages over the status quo:<br>
<br>
- Fields are named. Aside from readability, this prevents<br>
adding/reordering fields in the schema from requiring testcase<br>
updates.<br>
<br>
- Serialization graph becomes a DAG. Aside from readability, this<br>
removes most RAUW from assembly (and all RAUW from bitcode).<br>
<br>
- Structure is clear.<br></blockquote><div><br></div><div>One more comment on the thread: I really like this syntax :)</div><div><br></div><div>-eric </div></div>