diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-27 17:52:56 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-27 17:52:56 +0000 |
commit | 3c8455152e3d41b8e5f7b33c3ed99c7a8105f5a8 (patch) | |
tree | 19654372fc3f3039fbe8c26618d228200c793ae7 /lib/Analysis | |
parent | 54e98d921f7eabfd3baae5399e835ddc39a75e6c (diff) | |
download | external_llvm-3c8455152e3d41b8e5f7b33c3ed99c7a8105f5a8.zip external_llvm-3c8455152e3d41b8e5f7b33c3ed99c7a8105f5a8.tar.gz external_llvm-3c8455152e3d41b8e5f7b33c3ed99c7a8105f5a8.tar.bz2 |
Global Aliases are not identifiable objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/AliasAnalysis.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index 1d2efc1..c456990 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/lib/Analysis/AliasAnalysis.cpp @@ -233,13 +233,15 @@ bool llvm::isNoAliasCall(const Value *V) { /// isIdentifiedObject - Return true if this pointer refers to a distinct and /// identifiable object. This returns true for: -/// Global Variables and Functions +/// Global Variables and Functions (but not Global Aliases) /// Allocas and Mallocs /// ByVal and NoAlias Arguments /// NoAlias returns /// bool llvm::isIdentifiedObject(const Value *V) { - if (isa<GlobalValue>(V) || isa<AllocationInst>(V) || isNoAliasCall(V)) + if (isa<AllocationInst>(V) || isNoAliasCall(V)) + return true; + if (isa<GlobalValue>(V) && !isa<GlobalAlias>(V)) return true; if (const Argument *A = dyn_cast<Argument>(V)) return A->hasNoAliasAttr() || A->hasByValAttr(); |