Add some assertions
authorChris Lattner <sabre@nondot.org>
Wed, 15 Sep 2004 16:59:47 +0000 (16:59 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 15 Sep 2004 16:59:47 +0000 (16:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16366 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasSetTracker.cpp

index 15b4945c59241f2caaa4f37a361413800dcf58cc..b3f1a6d1612035259bb058906efd26ff814c838b 100644 (file)
@@ -50,6 +50,7 @@ void AliasSet::mergeSetIn(AliasSet &AS) {
 
     AS.PtrList = 0;
     AS.PtrListEnd = &AS.PtrList;
+    assert(*AS.PtrListEnd == 0 && "End of list is not null?");
   }
 }
 
@@ -70,11 +71,10 @@ void AliasSet::addPointer(AliasSetTracker &AST, HashNodePair &Entry,
                           unsigned Size, bool KnownMustAlias) {
   assert(!Entry.second.hasAliasSet() && "Entry already in set!");
 
-  AliasAnalysis &AA = AST.getAliasAnalysis();
-
   // Check to see if we have to downgrade to _may_ alias.
   if (isMustAlias() && !KnownMustAlias)
     if (HashNodePair *P = getSomePointer()) {
+      AliasAnalysis &AA = AST.getAliasAnalysis();
       AliasAnalysis::AliasResult Result =
         AA.alias(P->first, P->second.getSize(), Entry.first, Size);
       if (Result == AliasAnalysis::MayAlias)
@@ -91,6 +91,7 @@ void AliasSet::addPointer(AliasSetTracker &AST, HashNodePair &Entry,
   assert(*PtrListEnd == 0 && "End of list is not null?");
   *PtrListEnd = &Entry;
   PtrListEnd = Entry.second.setPrevInList(PtrListEnd);
+  assert(*PtrListEnd == 0 && "End of list is not null?");
   addRef();               // Entry points to alias set...
 }