[PATCH] Assembly/bitcode support for GenericDebugNode

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Feb 2 12:55:49 PST 2015


Add assembly/bitcode support to `GenericDebugNode`.  There are two
things I need reviewed here (although other comments are obviously
welcome):

  - The first three patches add a `dwarf::getTag()` to complement
    `dwarf::TagString()`.  There's a small functionality change in the
    first patch I want confirmation on: `dwarf::TagString()` will return
    `nullptr` for `DW_TAG_lo_user` (and related non-tags).  This
    constant is not really a DWARF tag; it's just a marker for the first
    recommended user-defined tag).  Stringifying it seems wrong (and
    would conflict with stringifying a user-defined tag of the same
    number).
  - The fourth patch adds assembly/bitcode support, and the fifth
    improves it by using `dwarf::getTag()`.  Here's the resulting
    syntax:

        !0 = !GenericDebugNode(tag: DW_TAG_entry_point,
                               header: "some\00header",
                               operands: {!1, !2, !7})

    This shouldn't be surprising (or a departure from the plan of
    record), but officially I need every assembly change reviewed
    pre-commit.

Note that this commit doesn't actually move `GenericDebugNode` into
place (and that's not the next step; more below for those interested).

(An extended side-note:

I've been sitting on these patches for a while, kind of stumped on the
best way to stage the rest of the work here.

Originally, I'd planned to move `GenericDebugNode` in underneath the
`DIDescriptor` classes right after this patch series.  This would have
required updating all the testcases to use it, only to subsequently
update every line *again* as I implemented the more specialized nodes
(making schema changes along the way).

Instead I'll be proceeding as follows: add specialized nodes that match
the current schema, add assembly/bitcode support for them (I have
out-of-tree patches that get to here), move them all underneath the
`DIDescriptor` hierarchy (only requiring each line to be updated
*once*), and then start hacking the schema once they're in place.

The new approach minimizes testcase churn, and (perhaps more
importantly) better separates the infrastructure changes (which are
rather mechanical) from the schema changes (which need more careful
consideration).)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-Stop-stringifying-DW_TAG_-lo-hi-_user.patch
Type: application/octet-stream
Size: 2960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150202/06c64658/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Support-Re-implement-dwarf-TagString-using-a-.def-fi.patch
Type: application/octet-stream
Size: 9553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150202/06c64658/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Support-Add-string-unsigned-mapping-for-DW_TAG.patch
Type: application/octet-stream
Size: 3864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150202/06c64658/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-IR-Assembly-and-bitcode-for-GenericDebugNode.patch
Type: application/octet-stream
Size: 16372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150202/06c64658/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-AsmParser-Recognize-DW_TAG_-constants.patch
Type: application/octet-stream
Size: 8858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150202/06c64658/attachment-0004.obj>


More information about the llvm-commits mailing list