[patch] Allow alias to point to an arbitrary ConstantExpr

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Jun 2 16:50:44 PDT 2014


On 2014 Jun 2, at 13:37, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

> Updated llvm and clang patches attached.
> 
> Cheers,
> Rafael
> <llvm.patch><clang.patch>

LGTM with a doc fixup:

> diff --git a/docs/LangRef.rst b/docs/LangRef.rst
> index 650012e..1bb7633 100644
> --- a/docs/LangRef.rst
> +++ b/docs/LangRef.rst
> @@ -691,17 +695,23 @@ Syntax::
>  
>  The linkage must be one of ``private``, ``internal``, ``linkonce``, ``weak``,
>  ``linkonce_odr``, ``weak_odr``, ``external``. Note that some system linkers
> -might not correctly handle dropping a weak symbol that is aliased by a non-weak
> -alias.
> +might not correctly handle dropping a weak symbol that is aliased.
>  
>  Alias that are not ``unnamed_addr`` are guaranteed to have the same address as
>  the aliasee.
>  
> -The aliasee must be a definition.
> +Since aliases are only a second name, some restrictions apply, of which
> +some can only be checked when producing an object file:
> +
> +* The expression defining the aliasee must be computable at assembly
> +  time. Since it is just a name, no relocations can be used.
> +
> +* No alias in the expression can be weak as the possibility of the
> +  intermediate alias being overridden cannot be represented in an
> +  object file.
>  
> -Aliases are not allowed to point to aliases with linkages that can be
> -overridden. Since they are only a second name, the possibility of the
> -intermediate alias being overridden cannot be represented in an object file.
> +* No global value in the expression can be a declaration, since that
> +  would require a relocation, with is not possible.

s/with/which






More information about the llvm-commits mailing list