From: Chris Lattner Date: Thu, 13 Nov 2003 18:48:11 +0000 (+0000) Subject: Trying to get the dsgraph for an external function is bad for DSA's health X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a366c98077d49d2df7e047d204a097c2c94be9c0;p=oota-llvm.git Trying to get the dsgraph for an external function is bad for DSA's health git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9979 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/DataStructure/CompleteBottomUp.cpp b/lib/Analysis/DataStructure/CompleteBottomUp.cpp index 326a794f7a0..8695537af5e 100644 --- a/lib/Analysis/DataStructure/CompleteBottomUp.cpp +++ b/lib/Analysis/DataStructure/CompleteBottomUp.cpp @@ -116,17 +116,18 @@ unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG, // Loop over all of the actually called functions... ActualCalleesTy::iterator I, E; - for (tie(I, E) = ActualCallees.equal_range(Call); I != E; ++I) { - DSGraph &Callee = getOrCreateGraph(*I->second); - unsigned M; - // Have we visited the destination function yet? - hash_map::iterator It = ValMap.find(&Callee); - if (It == ValMap.end()) // No, visit it now. - M = calculateSCCGraphs(Callee, Stack, NextID, ValMap); - else // Yes, get it's number. - M = It->second; - if (M < Min) Min = M; - } + for (tie(I, E) = ActualCallees.equal_range(Call); I != E; ++I) + if (!I->second->isExternal()) { + DSGraph &Callee = getOrCreateGraph(*I->second); + unsigned M; + // Have we visited the destination function yet? + hash_map::iterator It = ValMap.find(&Callee); + if (It == ValMap.end()) // No, visit it now. + M = calculateSCCGraphs(Callee, Stack, NextID, ValMap); + else // Yes, get it's number. + M = It->second; + if (M < Min) Min = M; + } } assert(ValMap[&FG] == MyID && "SCC construction assumption wrong!");