On 22/10/2013 15:23, Rafael Espindola wrote:
> Author: rafael
> Date: Tue Oct 22 09:23:09 2013
> New Revision: 193162
>
> URL: http://llvm.org/viewvc/llvm-project?rev=193162&view=rev
> 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")));
FWIW, swapping the order of alias declarations makes a difference.
Fails:
|void foo() __attribute__((alias("bar")));||
||void zed() __attribute__((alias("foo")));||
||void bar() {}||
||al.c:3:27: error: alias must point to a defined variable or function||
||void zed() __attribute__((alias("foo")));||
||
||declare void @foo(...) #0||
||void (...)* bitcast (void ()* @bar to void (...)*)|
Works:
|void zed() __attribute__((alias("foo")));||
||void foo() __attribute__((alias("bar")));||
||void bar() {}||
||
||void (...)* bitcast (void ()* @bar to void (...)*)||
||@foo = alias bitcast (void ()* @bar to void (...)*)|
So I don't think any of the Sema changes for PR17639 can help.
Isn't it rather a question of getting CodeGen to emit the GlobalDecls in
the right order?
Alp.
--
http://www.nuanti.com
the browser experts
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits