add some possibly bogus assertions.
authorChris Lattner <sabre@nondot.org>
Thu, 17 Mar 2005 20:33:27 +0000 (20:33 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 Mar 2005 20:33:27 +0000 (20:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20665 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructureAA.cpp

index 2d62162d1d9e73e304a0fe91e577c86f07a17282..8b606f2aabb7511f402a876e0cef693104a78a76 100644 (file)
@@ -12,6 +12,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/Constants.h"
+#include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/Passes.h"
@@ -196,6 +198,14 @@ DSAA::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
       Result = ModRefResult(Result & ~Mod);
     if (!N->isRead())       // We proved it was not read.
       Result = ModRefResult(Result & ~Ref);
+  } else {
+    if (isa<ConstantPointerNull>(P))
+      Result = NoModRef;
+    else
+      assert(isa<GlobalVariable>(P) &&
+    cast<GlobalVariable>(P)->getType()->getElementType()->isFirstClassType() &&
+             "This isn't a global that DSA inconsiderately dropped "
+             "from the graph?");
   }
   return Result;
 }