<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Yes, addFlag() does choose what to do based on version, and something like that for implicit const would work.  The fallback would use a regular addSInt().<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvm-commits [mailto:llvm-commits-bounces@lists.llvm.org]
<b>On Behalf Of </b>David Blaikie via llvm-commits<br>
<b>Sent:</b> Tuesday, February 28, 2017 5:05 PM<br>
<b>To:</b> reviews+D30377+public+7bf5043b5c30d2d5@reviews.llvm.org; vleschuk@accesssoftek.com; mehdi.amini@apple.com; echristo@gmail.com; aprantl@apple.com<br>
<b>Cc:</b> llvm-commits@lists.llvm.org<br>
<b>Subject:</b> Re: [PATCH] D30377: [DebugInfo] [DWARFv5] Support for DW_AT_calling_convention for types<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">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)<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">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:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">probinson added inline comments.<br>
<br>
<br>
================<br>
Comment at: lib/CodeGen/AsmPrinter/DwarfUnit.cpp:973<br>
+    // Add DW_AT_calling_convention attr.<br>
+    if (DD->getDwarfVersion() >= 5) {<br>
+      auto ArgABI = CTy->getArgABI();<br>
----------------<br>
aprantl wrote:<br>
> 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>
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>
<br>
<br>
<a href="https://reviews.llvm.org/D30377" target="_blank">https://reviews.llvm.org/D30377</a><br>
<br>
<br>
<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>