aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-27 17:52:56 +0000
committerDan Gohman <gohman@apple.com>2009-08-27 17:52:56 +0000
commit5753a4a0033da4add45f2e9930a4e1159d92a869 (patch)
tree19654372fc3f3039fbe8c26618d228200c793ae7
parent846a2f2703f6bb894098274964faf5dce0b68c4d (diff)
downloadexternal_llvm-5753a4a0033da4add45f2e9930a4e1159d92a869.tar.gz
external_llvm-5753a4a0033da4add45f2e9930a4e1159d92a869.tar.bz2
external_llvm-5753a4a0033da4add45f2e9930a4e1159d92a869.zip
Global Aliases are not identifiable objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80263 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/AliasAnalysis.h2
-rw-r--r--lib/Analysis/AliasAnalysis.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h
index 54006aea0e..be7d5ee37b 100644
--- a/include/llvm/Analysis/AliasAnalysis.h
+++ b/include/llvm/Analysis/AliasAnalysis.h
@@ -347,7 +347,7 @@ bool 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
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp
index 1d2efc1eda..c456990d8a 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();