aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-04 02:29:15 +0000
committerChris Lattner <sabre@nondot.org>2002-11-04 02:29:15 +0000
commit048912bad9a3164b340d25bd30a1e22385e12056 (patch)
tree8d8a34f47054910c413fee363b1183ac4f7886eb
parenta5cf9364f19b5db75820ba2f46b9f6ac463e4d71 (diff)
downloadexternal_llvm-048912bad9a3164b340d25bd30a1e22385e12056.zip
external_llvm-048912bad9a3164b340d25bd30a1e22385e12056.tar.gz
external_llvm-048912bad9a3164b340d25bd30a1e22385e12056.tar.bz2
Give a better error message in an unhandled case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4521 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/DataStructure/BottomUpClosure.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp
index a68e954..6b70490 100644
--- a/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -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));