Add a sanity check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-02-15 18:48:48 +00:00
parent d672ab936f
commit 7a0c775044

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)) {