Revert "Prevent alias from pointing to weak aliases."

This reverts commit r204781.

I will follow up to with msan folks to see what is what they
were trying to do with aliases to weak aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204784 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-03-26 06:14:40 +00:00
parent 360ee97179
commit 72db10a995
18 changed files with 61 additions and 58 deletions

View File

@@ -64,15 +64,23 @@ public:
Constant *getAliasee() {
return getOperand(0);
}
/// This method tries to ultimately resolve the alias by going through the
/// aliasing chain and trying to find the very last global. Returns NULL if a
/// cycle was found.
/// getAliasedGlobal() - Aliasee can be either global or bitcast of
/// global. This method retrives the global for both aliasee flavours.
GlobalValue *getAliasedGlobal();
const GlobalValue *getAliasedGlobal() const {
return const_cast<GlobalAlias *>(this)->getAliasedGlobal();
}
/// resolveAliasedGlobal() - This method tries to ultimately resolve the alias
/// by going through the aliasing chain and trying to find the very last
/// global. Returns NULL if a cycle was found. If stopOnWeak is false, then
/// the whole chain aliasing chain is traversed, otherwise - only strong
/// aliases.
GlobalValue *resolveAliasedGlobal(bool stopOnWeak = true);
const GlobalValue *resolveAliasedGlobal(bool stopOnWeak = true) const {
return const_cast<GlobalAlias *>(this)->resolveAliasedGlobal(stopOnWeak);
}
static bool isValidLinkage(LinkageTypes L) {
return isExternalLinkage(L) || isLocalLinkage(L) ||
isWeakLinkage(L) || isLinkOnceLinkage(L);