[patch] Don't disable const merging if an alias of a constant is llvm.used
Nick Lewycky
nicholas at mxc.ca
Sun May 5 16:00:00 PDT 2013
Rafael EspĂndola wrote:
> Right now we disable constant merging not only if a constant is
> llvm.used, but also if an alias of a constant is llvm.used. This patch
> fixes that.
+ /// \brief - Like stripPointerCasts, but don't strip GlobalAlias.
+ Value *stripPointerCastsOnly();
I'm fearful that we're going down the route of clang's IgnoreParens,
IgnoreParenCasts, IgnoreParenLValueCasts, ignoreParenBaseCasts,
IgnoreParenImpCasts ...
but anyways, please write the comment without reference to the nearby
functions. Also appending "Only" doesn't seem clear, something more like
NoFollowAliases sure is verbose but it's clearer.
Similarly, I'd rather we renamed PSK_ZeroIndices to
PSK_ZeroIndicesAndAliases, and your patch added the new PSK_ZeroIndices.
That aside, LGTM! I'm not going to block on style/naming issues.
Nick
More information about the llvm-commits
mailing list