[patch][PR10367] Fix the design of GlobalAlias

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed May 14 07:53:51 PDT 2014


>> What is still not implemented (and will be done in a followup patch)
>> is to add an offset field, so that we can represent an alias that is
>> inside another symbol.
>
> I'm a little worried about the complexity of supporting the full power
> of GEP here; it seems like a fair bit of duplicated logic.  Although,
> maybe you're not planning to support all of it?  Or maybe it'll be
> cleaner than I imagine.

Not the full power. Right now we only support all zero GEPs in the
expression. In the new model there is no expression, just a
GlobalObject. The offset with be just a constant number. Not a
ConstantExpr.

> I found a few of small things (clang-format level stuff) not worth
> mentioning yet, but make sure you update this comment:
>
>     /// ParseAlias:
>     ///   ::= GlobalVar '=' OptionalVisibility OptionalDLLStorageClass 'alias'
>     ///                     OptionalLinkage Aliasee
>     /// Aliasee
>     ///   ::= TypeAndValue
>     ///   ::= 'bitcast' '(' TypeAndValue 'to' Type ')'
>     ///   ::= 'getelementptr' 'inbounds'? '(' ... ')'
>     bool LLParser::ParseAlias(const std::string &Name, LocTy NameLoc,

Fixed. I will send an update patch soon.

Cheers,
Rafael



More information about the llvm-commits mailing list