Give a better error message in an unhandled case
authorChris Lattner <sabre@nondot.org>
Mon, 4 Nov 2002 02:29:15 +0000 (02:29 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 4 Nov 2002 02:29:15 +0000 (02:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4521 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/BottomUpClosure.cpp

index a68e9547f1ebfb87c9130658ac3a9a5f0b691019..6b70490feb731dbfebdc86698f534131930553bf 100644 (file)
@@ -61,7 +61,14 @@ static void ResolveArguments(DSCallSite &Call, Function &F,
   Function::aiterator AI = F.abegin();
   for (unsigned i = 0, e = Call.getNumPtrArgs(); i != e; ++i, ++AI) {
     // Advance the argument iterator to the first pointer argument...
-    while (!isPointerType(AI->getType())) ++AI;
+    while (!isPointerType(AI->getType())) {
+      ++AI;
+#ifndef NDEBUG
+      if (AI == F.aend())
+        std::cerr << "Bad call to Function: " << F.getName() << "\n";
+#endif
+      assert(AI != F.aend() && "# Args provided is not # Args required!");
+    }
     
     // Add the link from the argument scalar to the provided value
     ScalarMap[AI].mergeWith(Call.getPtrArg(i));