This LGTM. I like the new syntax. Feel free to commit as soon as you have the LangRef changes handy.<div><br></div><div>-eric<br><br><div class="gmail_quote">On Mon Jan 12 2015 at 8:34:18 PM Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">After splitting `Metadata` apart from `Value`, I'm finally back to the<br>
first step [1] of representing debug info more directly in IR [2]:<br>
`MDLocation`.<br>
<br>
[1]: <a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-October/078173.html" target="_blank">http://lists.cs.uiuc.edu/<u></u>pipermail/llvmdev/2014-<u></u>October/078173.html</a><br>
"First-class debug info IR: MDLocation"<br>
[2]: <a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-October/077715.html" target="_blank">http://lists.cs.uiuc.edu/<u></u>pipermail/llvmdev/2014-<u></u>October/077715.html</a><br>
"Less memory and greater maintainability for debug info IR"<br>
<br>
I've attached two patches which are both essentially commit-ready (just<br>
missing LangRef update, AFAIK), although they just add the class and<br>
assembly/bitcode support. Once it's in tree, I'll move it into place<br>
underneath `DebugLoc` and `DILocation` and update the world of<br>
testcases, publish a script, and so forth.<br>
<br>
Assembly syntax<br>
===============<br>
<br>
I've changed the assembly syntax a little since my previous proposal<br>
[1], but I kept the fundamentals the same:<br>
<br>
- Fields use key/value pairs and can be specified in any order.<br>
- No types (unless you're referencing a `Value`).<br>
- Some fields are required (in this case, 'scope:').<br>
- Unspecified fields get sane default values.<br>
<br>
Old syntax:<br>
<br>
!6 = metadata MDLocation(line: 43, column: 7, scope: !4)<br>
<br>
Now it's:<br>
<br>
!6 = !MDLocation(line: 43, column: 7, scope: !4)<br>
<br>
Here's why:<br>
<br>
- Dropped 'metadata' since `Metadata` is now typeless \O/.<br>
<br>
- Added a '!' since it makes the parser simpler (no changes to the<br>
lexer, since we can unambiguously reuse the `MetadataVar` token),<br>
and follows the rule that "All metadata are identified in syntax by<br>
a[n] exclamation point" [3]. (If people are opposed to the extra<br>
'!' I can update this sentence instead, but it seems like a handy<br>
mnemonic to maintain.)<br>
<br>
[3]: <a href="http://llvm.org/docs/LangRef.html#metadata" target="_blank">http://llvm.org/docs/LangRef.<u></u>html#metadata</a><br>
<br>
Where this is heading<br>
=====================<br>
<br>
See my previous post [1] ;).<br>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</blockquote></div></div>