[llvm-commits] [PATCH][RFC] PR10367: don't allow GlobalAlias's aliasee to be an arbitrary Constant

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Thu Jul 28 15:35:12 PDT 2011


> If we go this way then we eliminate the possibility of having an alias into
> the middle of a global variable.  This has been requested a few times on the
> mailing list.  For example, recently someone wanted to put canaries around
> global variables.  To put such a buffer around a global variable G, the idea
> is to create a new global G2 of the form "{ buff_type, typeof(G), buff_type }"
> and then replace G with an alias of the middle field (of type typeof(G)) in
> G2.  This seems like a useful thing to be able to do.  So I reckon first we
> need to decide if want to move towards allowing this, or away from allowing
> it (your patch moves away).

A similar use case would be merging two global constants where one is a 
subrange of the other.


Cheers,
Rafael



More information about the llvm-commits mailing list