]> granicus.if.org Git - clang/commit
New fix for pr17535.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 22 Oct 2013 19:26:13 +0000 (19:26 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 22 Oct 2013 19:26:13 +0000 (19:26 +0000)
commitd205498c83c1bba1004ae41299ad7138881b9480
treee9603b20ec709764a4110a927b0fabe27a55183c
parentbb6144beedc7cbf8df9822024c20c3a8172682c1
New fix for pr17535.

This is a fixed version of r193161. In order to handle

    void foo() __attribute__((alias("bar")));
    void bar() {}
    void zed() __attribute__((alias("foo")));

it is not enough to delay aliases to the end of the TU, we have to do two
passes over them to find if they are defined or not.

This can be implemented by producing alias as we go and just doing the second
pass at the end. This has the advantage that other parts of clang that were
expecting alias to be processed in order don't have to be changed.

This patch also handles cyclic aliases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193188 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/Sema/attr-alias-elf.c [new file with mode: 0644]