summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-04 21:28:47 +0000
committerChris Lattner <sabre@nondot.org>2004-12-04 21:28:47 +0000
commit8145bd5006633e48628816c2d8a174059386bb24 (patch)
treeb6cd71a8c7f9ef8a83d827a36e79fe62b8d45c6e /llvm/lib/Bytecode/Writer/SlotCalculator.cpp
parenta27dd47e7abbf7f7f046df03dc460a8f425a72c2 (diff)
downloadbcm5719-llvm-8145bd5006633e48628816c2d8a174059386bb24.tar.gz
bcm5719-llvm-8145bd5006633e48628816c2d8a174059386bb24.zip
Check in some patches for better assertions
llvm-svn: 18500
Diffstat (limited to 'llvm/lib/Bytecode/Writer/SlotCalculator.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/SlotCalculator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
index 575dd34dbdf..4a95c7b80f9 100644
--- a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
+++ b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
@@ -691,6 +691,9 @@ int SlotCalculator::getOrCreateSlot(const Value *V) {
int SlotNo = getSlot(V); // Check to see if it's already in!
if (SlotNo != -1) return SlotNo;
+ if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
+ assert(GV->getParent() != 0 && "Global not embedded into a module!");
+
if (!isa<GlobalValue>(V)) // Initializers for globals are handled explicitly
if (const Constant *C = dyn_cast<Constant>(V)) {
assert(CompactionNodeMap.empty() &&
OpenPOWER on IntegriCloud