<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 02/13/2017 06:46 PM, Reid Kleckner
      via cfe-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CACs=tyJK5eKs8fa9NbA4U2oTry9EdRMGH74LXvAW_7j811h6=w@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">Sounds totally reasonable.</div>
    </blockquote>
    <br>
    I agree, but can you be more specific about how this will work? Does
    this apply only to function declarations or to all declarations? If
    the latter, will the attribute be applied to all relevant things in
    the subject list for the attribute? Will parsing be delayed? I'm
    wondering how this might work with enable_if.<br>
    <br>
    Also, I don't think we should restrict this to declarations because
    applying to definitions would be useful too. For example
    push(__attribute__((target("avx")))) seems useful.<br>
    <br>
     -Hal<br>
    <br>
    <blockquote
cite="mid:CACs=tyJK5eKs8fa9NbA4U2oTry9EdRMGH74LXvAW_7j811h6=w@mail.gmail.com"
      type="cite">
      <div dir="ltr"> I prefer '#pragma clang attribute push(...)' to
        the other one, since it will fit more easily into our pragma
        handler code.
        <div><br>
        </div>
        <div>The infrastructure for managing pragma stacks that apply
          attributes to decls should be in decent shape at this point
          after adding all the stack-based MS pragmas. If it isn't, we
          should refactor things more, since this is a pretty common
          pattern.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Feb 13, 2017 at 4:24 PM, Alex L
          via cfe-dev <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Hi,
              <div><br>
              </div>
              <div>I would like to propose a new Clang pragma that would
                apply a specified attribute to some specific
                declarations in a source file. Initially the pragma
                would only work with annotation-like attributes that
                explicitly opt-in into allowing this pragma. This will
                ensure that this pragma can avoid conflicts with other
                pragmas that apply attributes like "#pragma clang
                optimize off", etc. The set of declarations that receive
                the attribute would be attribute-specific. </div>
              <div><br>
              </div>
              <div>I would like to propose the following syntax:</div>
              <div><br>
              </div>
              <div>    #pragma clang attribute
                push(annotate("important")) // or maybe
                push(__attribute__(annotate("<wbr>important")))?</div>
              <div><br>
              </div>
              <div>    void foo(); // This function will now have the
                annotate("important") attribute.</div>
              <div><br>
              </div>
              <div>    #pragma clang attribute pop</div>
              <div><br>
              </div>
              <div>We would like to use this pragma to apply the new
                'external_source_attribute' (<a moz-do-not-send="true"
                  href="https://reviews.llvm.org/D29819"
                  rel="noreferrer"
                  style="font-size:12.800000190734863px" target="_blank">https://reviews.llvm.org/D298<wbr>19</a>)
                to all of the declarations in an Objective-C header file
                that was auto-generated by the Swift compiler without
                adding additional attribute/macro to each declaration.</div>
              <div><br>
              </div>
              <div>Do you have any thoughts / suggestions about this
                proposal?</div>
              <div><br>
              </div>
              <div>Cheers,</div>
              <div>Alex</div>
            </div>
            <br>
            ______________________________<wbr>_________________<br>
            cfe-dev mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev"
              rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </body>
</html>