<div dir="ltr">We'll probably want to add a generic function that can choose between implicit_const and  a DWARF4 form - because we'll probably want to use implicit_const for existing attributes (like accessibility, etc). How do we handle form_present? I think we have a high level "add Flag" operation that uses form_present or something backwards compatible depending on the target DWARF verison)</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Feb 28, 2017 at 3:26 PM Paul Robinson via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">probinson added inline comments.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: lib/CodeGen/AsmPrinter/DwarfUnit.cpp:973<br class="gmail_msg">
+    // Add DW_AT_calling_convention attr.<br class="gmail_msg">
+    if (DD->getDwarfVersion() >= 5) {<br class="gmail_msg">
+      auto ArgABI = CTy->getArgABI();<br class="gmail_msg">
----------------<br class="gmail_msg">
aprantl wrote:<br class="gmail_msg">
> Technically true, but I think there is no harm in emitting this attribute also in DWARF 4 or earlier. We usually only do this if the new attribute cannot be safely ignored by an older consumer.<br class="gmail_msg">
Actually DW_FORM_implicit_const is new in DWARF 5, and new FORMs cannot be used in prior-version DIEs.  So, either we have to guard the entire attribute, or we have to conditionalize the FORM.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D30377" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D30377</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>