Add a sanity check.

llvm-svn: 20195
This commit is contained in:
Chris Lattner 2005-02-15 18:48:48 +00:00
parent 219002ed8f
commit 3e708301d2
1 changed files with 1 additions and 0 deletions

View File

@ -1148,6 +1148,7 @@ DSNode *DSGraph::addObjectToGraph(Value *Ptr, bool UseDeclaredType) {
assert(isa<PointerType>(Ptr->getType()) && "Ptr is not a pointer!");
const Type *Ty = cast<PointerType>(Ptr->getType())->getElementType();
DSNode *N = new DSNode(UseDeclaredType ? Ty : 0, this);
assert(ScalarMap[Ptr].isNull() && "Object already in this graph!");
ScalarMap[Ptr] = N;
if (GlobalValue *GV = dyn_cast<GlobalValue>(Ptr)) {