From 7d8d4711d92e72b5a6e6085eb2457683aeb6003d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 31 Oct 2004 17:45:40 +0000 Subject: [PATCH] Add more paranoid assertions :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17367 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/DataStructure.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index bd5c5607cf2..60aa7666631 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -1973,6 +1973,18 @@ void DSGraph::AssertGraphOK() const { } AssertCallNodesInGraph(); AssertAuxCallNodesInGraph(); + + // Check that all pointer arguments to any functions in this graph have + // destinations. + for (ReturnNodesTy::const_iterator RI = ReturnNodes.begin(), + E = ReturnNodes.end(); + RI != E; ++RI) { + Function &F = *RI->first; + for (Function::aiterator AI = F.abegin(); AI != F.aend(); ++AI) + if (isPointerType(AI->getType())) + assert(!getNodeForValue(AI).isNull() && + "Pointer argument must be in the scalar map!"); + } } /// computeNodeMapping - Given roots in two different DSGraphs, traverse the