diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-11-21 19:42:56 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-11-21 19:42:56 +0000 |
commit | 9f47fb66370e5513bb9f737923e8cb476088acec (patch) | |
tree | f67d6d837f3080225341c04e8eae07a439fb1e29 /lib/Analysis | |
parent | 6935b78e6f3b7dca7786041c56c9a795d2247659 (diff) |
Fix crasher in GVN due to my recent capture tracking changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/CaptureTracking.cpp | 3 | ||||
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/CaptureTracking.cpp b/lib/Analysis/CaptureTracking.cpp index 03bd70dfa3..9a7992e38d 100644 --- a/lib/Analysis/CaptureTracking.cpp +++ b/lib/Analysis/CaptureTracking.cpp @@ -53,6 +53,9 @@ namespace { /// counts as capturing it or not. bool llvm::PointerMayBeCaptured(const Value *V, bool ReturnCaptures, bool StoreCaptures) { + assert(!isa<GlobalValue>(V) && + "It doesn't make sense to ask whether a global is captured."); + // TODO: If StoreCaptures is not true, we could do Fancy analysis // to determine whether this store is not actually an escape point. // In that case, BasicAliasAnalysis should be updated as well to diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index 128c7f93a4..704e27b5ce 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -375,7 +375,7 @@ MemoryDependenceAnalysis::getModRefInfo(const Instruction *Inst, // with a smarter AA in place, this test is just wasting compile time. if (!DT) return AliasAnalysis::ModRef; const Value *Object = GetUnderlyingObject(MemLoc.Ptr, TD); - if (!isIdentifiedObject(Object) || isa<GlobalVariable>(Object)) + if (!isIdentifiedObject(Object) || isa<GlobalValue>(Object)) return AliasAnalysis::ModRef; ImmutableCallSite CS(Inst); if (!CS.getInstruction()) return AliasAnalysis::ModRef; |