aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CaptureTracking.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-11-21 19:42:56 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-11-21 19:42:56 +0000
commit063ae5897c7a46481ecf43cc7e94328719e9f26c (patch)
treea7ce434bab2362a81a7c2afddc8e6b3b5c23ebc7 /llvm/lib/Analysis/CaptureTracking.cpp
parent9a56882e53cbe26e201d942cd7d1380879b3af86 (diff)
downloadllvm-063ae5897c7a46481ecf43cc7e94328719e9f26c.zip
llvm-063ae5897c7a46481ecf43cc7e94328719e9f26c.tar.gz
llvm-063ae5897c7a46481ecf43cc7e94328719e9f26c.tar.bz2
Fix crasher in GVN due to my recent capture tracking changes.
llvm-svn: 145047
Diffstat (limited to 'llvm/lib/Analysis/CaptureTracking.cpp')
-rw-r--r--llvm/lib/Analysis/CaptureTracking.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp
index 03bd70d..9a7992e3 100644
--- a/llvm/lib/Analysis/CaptureTracking.cpp
+++ b/llvm/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