<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 22/10/2013 15:23, Rafael Espindola
      wrote:<br>
    </div>
    <blockquote cite="mid:20131022142309.C56312A6C029@llvm.org"
      type="cite">
      <pre wrap="">Author: rafael
Date: Tue Oct 22 09:23:09 2013
New Revision: 193162

URL: <a class="moz-txt-link-freetext" href="http://llvm.org/viewvc/llvm-project?rev=193162&view=rev">http://llvm.org/viewvc/llvm-project?rev=193162&view=rev</a>
Log:
Revert "This patch causes clang to reject alias attributes that point to undefined names. For example, with this patch we now reject"

This reverts commit r193161.

It broke

void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));</pre>
    </blockquote>
    <br>
    FWIW, swapping the order of alias declarations makes a difference.<br>
    <br>
    Fails:<br>
    <br>
    <code>void foo() __attribute__((alias("bar")));</code><code><br>
    </code><code>
      void zed() __attribute__((alias("foo")));</code><code><br>
    </code><code>
      void bar() {}</code><code><br>
    </code><code>al.c:3:27: error: alias must point to a defined
      variable or function</code><code><br>
    </code><code>
      void zed() __attribute__((alias("foo")));</code><code><br>
    </code><code><br>
    </code><code>declare void @foo(...) #0</code><code><br>
    </code><code>void (...)* bitcast (void ()* @bar to void (...)*)</code><br>
    <br>
    <br>
    Works:<br>
    <br>
    <code>void zed() __attribute__((alias("foo")));</code><code><br>
    </code><code>void foo() __attribute__((alias("bar")));</code><code><br>
    </code><code>void bar() {}</code><code><br>
    </code><code><br>
    </code><code>void (...)* bitcast (void ()* @bar to void (...)*)</code><code><br>
    </code><code>@foo = alias bitcast (void ()* @bar to void (...)*)</code><br>
    <br>
    <br>
    So I don't think any of the Sema changes for PR17639 can help.<br>
    <br>
    Isn't it rather a question of getting CodeGen to emit the
    GlobalDecls in the right order?<br>
    <br>
    Alp.<br>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.nuanti.com">http://www.nuanti.com</a>
the browser experts
</pre>
  </body>
</html>