Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane

From: Duncan P. N. Exon Smith <dexonsmith <at> apple.com>
Subject: [RFC] First-class debug info IR: MDLocation (redux)
Newsgroups: gmane.comp.compilers.llvm.devel
Date: Tuesday 13th January 2015 04:30:21 UTC (over 3 years ago)
After splitting `Metadata` apart from `Value`, I'm finally back to the
first step [1] of representing debug info more directly in IR [2]:
`MDLocation`.

[1]: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-October/078173.html
        "First-class debug info IR: MDLocation"
[2]: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-October/077715.html
        "Less memory and greater maintainability for debug info IR"

I've attached two patches which are both essentially commit-ready (just
missing LangRef update, AFAIK), although they just add the class and
assembly/bitcode support.  Once it's in tree, I'll move it into place
underneath `DebugLoc` and `DILocation` and update the world of
testcases, publish a script, and so forth.

Assembly syntax
===============

I've changed the assembly syntax a little since my previous proposal
[1], but I kept the fundamentals the same:

  - Fields use key/value pairs and can be specified in any order.
  - No types (unless you're referencing a `Value`).
  - Some fields are required (in this case, 'scope:').
  - Unspecified fields get sane default values.

Old syntax:

    !6 = metadata MDLocation(line: 43, column: 7, scope: !4)

Now it's:

    !6 = !MDLocation(line: 43, column: 7, scope: !4)

Here's why:

  - Dropped 'metadata' since `Metadata` is now typeless \O/.

  - Added a '!' since it makes the parser simpler (no changes to the
    lexer, since we can unambiguously reuse the `MetadataVar` token),
    and follows the rule that "All metadata are identified in syntax by
    a[n] exclamation point" [3].  (If people are opposed to the extra
    '!' I can update this sentence instead, but it seems like a handy
    mnemonic to maintain.)

[3]: http://llvm.org/docs/LangRef.html#metadata

Where this is heading
=====================

See my previous post [1] ;).
 
CD: 4ms