Add a sanity check.
authorChris Lattner <sabre@nondot.org>
Tue, 15 Feb 2005 18:48:48 +0000 (18:48 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 15 Feb 2005 18:48:48 +0000 (18:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20195 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp

index c0e3ef46b21c90e559670ec0a48bc9e804dfb454..98fb07dff2d5d5b9eb47312e3d803630e5f06231 100644 (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)) {