[llvm-commits] CVS: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp CallTargets.cpp CompleteBottomUp.cpp DataStructure.cpp DataStructureAA.cpp DataStructureOpt.cpp EquivClassGraphs.cpp Local.cpp Steensgaard.cpp TopDownClosure.cpp

Patrick Meredith pmeredit at cs.uiuc.edu
Fri Feb 23 14:49:49 PST 2007



Changes in directory llvm-poolalloc/lib/DSA:

BottomUpClosure.cpp updated: 1.129 -> 1.130
CallTargets.cpp updated: 1.10 -> 1.11
CompleteBottomUp.cpp updated: 1.41 -> 1.42
DataStructure.cpp updated: 1.258 -> 1.259
DataStructureAA.cpp updated: 1.41 -> 1.42
DataStructureOpt.cpp updated: 1.17 -> 1.18
EquivClassGraphs.cpp updated: 1.55 -> 1.56
Local.cpp updated: 1.167 -> 1.168
Steensgaard.cpp updated: 1.68 -> 1.69
TopDownClosure.cpp updated: 1.97 -> 1.98
---
Log message:

Made to compile with newest version of llvm tree


---
Diffs of the changes:  (+52 -51)

 BottomUpClosure.cpp  |   10 +++++-----
 CallTargets.cpp      |    2 +-
 CompleteBottomUp.cpp |   12 ++++++------
 DataStructure.cpp    |   18 +++++++++---------
 DataStructureAA.cpp  |    3 ++-
 DataStructureOpt.cpp |    2 +-
 EquivClassGraphs.cpp |   18 +++++++++---------
 Local.cpp            |   18 +++++++++---------
 Steensgaard.cpp      |    6 +++---
 TopDownClosure.cpp   |   14 +++++++-------
 10 files changed, 52 insertions(+), 51 deletions(-)


Index: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp
diff -u llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.129 llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.130
--- llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.129	Wed Jan 10 12:10:32 2007
+++ llvm-poolalloc/lib/DSA/BottomUpClosure.cpp	Fri Feb 23 16:49:32 2007
@@ -163,13 +163,13 @@
   hash_map<Function*, unsigned> ValMap;
   unsigned NextID = 1;
 
-  Function *MainFunc = M.getMainFunction();
+  Function *MainFunc = M.getFunction("main");
   if (MainFunc)
     calculateGraphs(MainFunc, Stack, NextID, ValMap);
 
   // Calculate the graphs for any functions that are unreachable from main...
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal() && !DSInfo.count(I)) {
+    if (!I->isDeclaration() && !DSInfo.count(I)) {
       if (MainFunc)
         DOUT << "*** BU: Function unreachable from main: "
              << I->getName() << "\n";
@@ -212,7 +212,7 @@
   // Merge the globals variables (not the calls) from the globals graph back
   // into the main function's graph so that the main function contains all of
   // the information about global pools and GV usage in the program.
-  if (MainFunc && !MainFunc->isExternal()) {
+  if (MainFunc && !MainFunc->isDeclaration()) {
     DSGraph &MainGraph = getOrCreateGraph(MainFunc);
     const DSGraph &GG = *MainGraph.getGlobalsGraph();
     ReachabilityCloner RC(MainGraph, GG,
@@ -280,7 +280,7 @@
 }
 
 static bool isResolvableFunc(const Function* callee) {
-  return !callee->isExternal() || isVAHackFn(callee);
+  return !callee->isDeclaration() || isVAHackFn(callee);
 }
 
 static void GetAllCallees(const DSCallSite &CS,
@@ -349,7 +349,7 @@
   // FIXME!  This test should be generalized to be any function that we have
   // already processed, in the case when there isn't a main or there are
   // unreachable functions!
-  if (F->isExternal()) {   // sprintf, fprintf, sscanf, etc...
+  if (F->isDeclaration()) {   // sprintf, fprintf, sscanf, etc...
     // No callees!
     Stack.pop_back();
     ValMap[F] = ~0;


Index: llvm-poolalloc/lib/DSA/CallTargets.cpp
diff -u llvm-poolalloc/lib/DSA/CallTargets.cpp:1.10 llvm-poolalloc/lib/DSA/CallTargets.cpp:1.11
--- llvm-poolalloc/lib/DSA/CallTargets.cpp:1.10	Wed Jan 10 13:59:52 2007
+++ llvm-poolalloc/lib/DSA/CallTargets.cpp	Fri Feb 23 16:49:32 2007
@@ -42,7 +42,7 @@
 {
   TDDataStructures* T = &getAnalysis<TDDataStructures>();
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal())
+    if (!I->isDeclaration())
       for (Function::iterator F = I->begin(), FE = I->end(); F != FE; ++F)
         for (BasicBlock::iterator B = F->begin(), BE = F->end(); B != BE; ++B)
           if (isa<CallInst>(B) || isa<InvokeInst>(B)) {


Index: llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp
diff -u llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.41 llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.42
--- llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.41	Wed Jan 10 12:10:32 2007
+++ llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp	Fri Feb 23 16:49:32 2007
@@ -46,16 +46,16 @@
   hash_map<DSGraph*, unsigned> ValMap;
   unsigned NextID = 1;
 
-  Function *MainFunc = M.getMainFunction();
+  Function *MainFunc = M.getFunction("main");
   if (MainFunc) {
-    if (!MainFunc->isExternal())
+    if (!MainFunc->isDeclaration())
       calculateSCCGraphs(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap);
   } else {
     DOUT << "CBU-DSA: No 'main' function found!\n";
   }
 
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal() && !DSInfo.count(I)) {
+    if (!I->isDeclaration() && !DSInfo.count(I)) {
       if (MainFunc) {
         DOUT << "*** CBU: Function unreachable from main: "
              << I->getName() << "\n";
@@ -69,7 +69,7 @@
   // Merge the globals variables (not the calls) from the globals graph back
   // into the main function's graph so that the main function contains all of
   // the information about global pools and GV usage in the program.
-  if (MainFunc && !MainFunc->isExternal()) {
+  if (MainFunc && !MainFunc->isDeclaration()) {
     DSGraph &MainGraph = getOrCreateGraph(*MainFunc);
     const DSGraph &GG = *MainGraph.getGlobalsGraph();
     ReachabilityCloner RC(MainGraph, GG,
@@ -129,7 +129,7 @@
     callee_iterator I = callee_begin(Call), E = callee_end(Call);
     for (; I != E && I->first == Call; ++I) {
       assert(I->first == Call && "Bad callee construction!");
-      if (!I->second->isExternal()) {
+      if (!I->second->isDeclaration()) {
         DSGraph &Callee = getOrCreateGraph(*I->second);
         unsigned M;
         // Have we visited the destination function yet?
@@ -209,7 +209,7 @@
     for (; I != E; ++I, ++TNum) {
       assert(I->first == TheCall && "Bad callee construction!");
       Function *CalleeFunc = I->second;
-      if (!CalleeFunc->isExternal()) {
+      if (!CalleeFunc->isDeclaration()) {
         // Merge the callee's graph into this graph.  This works for normal
         // calls or for self recursion within an SCC.
         DSGraph &GI = getOrCreateGraph(*CalleeFunc);


Index: llvm-poolalloc/lib/DSA/DataStructure.cpp
diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.258 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.259
--- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.258	Mon Jan 22 11:03:41 2007
+++ llvm-poolalloc/lib/DSA/DataStructure.cpp	Fri Feb 23 16:49:32 2007
@@ -392,7 +392,7 @@
           if (SS.Idx != ST->getNumElements()) {
             const StructLayout *SL = TD.getStructLayout(ST);
             SS.Offset +=
-               unsigned(SL->MemberOffsets[SS.Idx]-SL->MemberOffsets[SS.Idx-1]);
+               unsigned(SL->getElementOffset(SS.Idx)-SL->getElementOffset(SS.Idx-1));
             return;
           }
           Stack.pop_back();  // At the end of the structure
@@ -423,7 +423,7 @@
             assert(SS.Idx < ST->getNumElements());
             const StructLayout *SL = TD.getStructLayout(ST);
             Stack.push_back(StackState(ST->getElementType(SS.Idx),
-                            SS.Offset+unsigned(SL->MemberOffsets[SS.Idx])));
+                            SS.Offset+unsigned(SL->getElementOffset(SS.Idx))));
           }
         } else {
           const ArrayType *AT = cast<ArrayType>(SS.Ty);
@@ -576,7 +576,7 @@
         const StructLayout &SL = *TD.getStructLayout(STy);
         unsigned i = SL.getElementContainingOffset(Offset);
         //Either we hit it exactly or give up
-        if (SL.MemberOffsets[i] != Offset) {
+        if (SL.getElementOffset(i) != Offset) {
           if (FoldIfIncompatible) foldNodeCompletely();
           return true;
         }
@@ -601,7 +601,7 @@
         const StructLayout &SL = *TD.getStructLayout(STy);
         unsigned i = SL.getElementContainingOffset(Offset);
         //Either we hit it exactly or give up
-        if (SL.MemberOffsets[i] != Offset) {
+        if (SL.getElementOffset(i) != Offset) {
           if (FoldIfIncompatible) foldNodeCompletely();
           return true;
         }
@@ -665,7 +665,7 @@
 
       // The offset we are looking for must be in the i'th element...
       SubType = STy->getElementType(i);
-      O += (unsigned)SL.MemberOffsets[i];
+      O += (unsigned)SL.getElementOffset(i);
       break;
     }
     case Type::ArrayTyID: {
@@ -715,8 +715,8 @@
     case Type::StructTyID: {
       const StructType *STy = cast<StructType>(SubType);
       const StructLayout &SL = *TD.getStructLayout(STy);
-      if (SL.MemberOffsets.size() > 1)
-        NextPadSize = (unsigned)SL.MemberOffsets[1];
+      if (STy->getNumElements() > 1)
+        NextPadSize = (unsigned)SL.getElementOffset(1);
       else
         NextPadSize = SubTypeSize;
       NextSubType = STy->getElementType(0);
@@ -1998,7 +1998,7 @@
   // them specially
   for (std::list<DSCallSite>::iterator I = FunctionCalls.begin(),
          E = FunctionCalls.end(); I != E; ++I)
-    if(I->isDirectCall() && I->getCalleeFunc()->isExternal())
+    if(I->isDirectCall() && I->getCalleeFunc()->isDeclaration())
       markIncomplete(*I);
 
   // Mark all global nodes as incomplete.
@@ -2023,7 +2023,7 @@
   std::vector<Function*> Funcs;
   N->addFullFunctionList(Funcs);
   for (unsigned i = 0, e = Funcs.size(); i != e; ++i)
-    if (Funcs[i]->isExternal()) return true;
+    if (Funcs[i]->isDeclaration()) return true;
   return false;
 }
 


Index: llvm-poolalloc/lib/DSA/DataStructureAA.cpp
diff -u llvm-poolalloc/lib/DSA/DataStructureAA.cpp:1.41 llvm-poolalloc/lib/DSA/DataStructureAA.cpp:1.42
--- llvm-poolalloc/lib/DSA/DataStructureAA.cpp:1.41	Wed Dec 13 23:51:06 2006
+++ llvm-poolalloc/lib/DSA/DataStructureAA.cpp	Fri Feb 23 16:49:32 2007
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
@@ -220,7 +221,7 @@
 
   if (!F) return AliasAnalysis::getModRefInfo(CS, P, Size);
 
-  if (F->isExternal()) {
+  if (F->isDeclaration()) {
     // If we are calling an external function, and if this global doesn't escape
     // the portion of the program we have analyzed, we can draw conclusions
     // based on whether the global escapes the program.


Index: llvm-poolalloc/lib/DSA/DataStructureOpt.cpp
diff -u llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.17 llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.18
--- llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.17	Wed Jan 10 13:59:52 2007
+++ llvm-poolalloc/lib/DSA/DataStructureOpt.cpp	Fri Feb 23 16:49:32 2007
@@ -60,7 +60,7 @@
   bool Changed = false;
 
   for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
-    if (!I->isExternal()) { // Loop over all of the non-external globals...
+    if (!I->isDeclaration()) { // Loop over all of the non-external globals...
       // Look up the node corresponding to this global, if it exists.
       DSNode *GNode = 0;
       DSGraph::ScalarMapTy::const_iterator SMI = SM.find(I);


Index: llvm-poolalloc/lib/DSA/EquivClassGraphs.cpp
diff -u llvm-poolalloc/lib/DSA/EquivClassGraphs.cpp:1.55 llvm-poolalloc/lib/DSA/EquivClassGraphs.cpp:1.56
--- llvm-poolalloc/lib/DSA/EquivClassGraphs.cpp:1.55	Wed Jan 10 12:10:32 2007
+++ llvm-poolalloc/lib/DSA/EquivClassGraphs.cpp	Fri Feb 23 16:49:32 2007
@@ -41,7 +41,7 @@
 template<typename GT>
 static void CheckAllGraphs(Module *M, GT &ECGraphs) {
   for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
-    if (!I->isExternal()) {
+    if (!I->isDeclaration()) {
       DSGraph &G = ECGraphs.getDSGraph(*I);
       if (G.retnodes_begin()->first != I)
         continue;  // Only check a graph once.
@@ -86,15 +86,15 @@
   std::map<DSGraph*, unsigned> ValMap;
   unsigned NextID = 1;
 
-  Function *MainFunc = M.getMainFunction();
-  if (MainFunc && !MainFunc->isExternal()) {
+  Function *MainFunc = M.getFunction("main");
+  if (MainFunc && !MainFunc->isDeclaration()) {
     processSCC(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap);
   } else {
     cerr << "Fold Graphs: No 'main' function found!\n";
   }
 
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal())
+    if (!I->isDeclaration())
       processSCC(getOrCreateGraph(*I), Stack, NextID, ValMap);
 
   DEBUG(CheckAllGraphs(&M, *this));
@@ -105,7 +105,7 @@
   // Merge the globals variables (not the calls) from the globals graph back
   // into the main function's graph so that the main function contains all of
   // the information about global pools and GV usage in the program.
-  if (MainFunc && !MainFunc->isExternal()) {
+  if (MainFunc && !MainFunc->isDeclaration()) {
     DSGraph &MainGraph = getOrCreateGraph(*MainFunc);
     const DSGraph &GG = *MainGraph.getGlobalsGraph();
     ReachabilityCloner RC(MainGraph, GG,
@@ -163,7 +163,7 @@
   Instruction *LastInst = 0;
   Function *FirstFunc = 0;
   for (ActualCalleesTy::const_iterator I=AC.begin(), E=AC.end(); I != E; ++I) {
-    if (I->second->isExternal())
+    if (I->second->isDeclaration())
       continue;                         // Ignore functions we cannot modify
 
     CallSite CS = CallSite::get(I->first);
@@ -335,7 +335,7 @@
     // Loop over all of the actually called functions...
     for (callee_iterator I = callee_begin(Call), E = callee_end(Call);
          I != E; ++I)
-      if (!I->second->isExternal()) {
+      if (!I->second->isDeclaration()) {
         // Process the callee as necessary.
         unsigned M = processSCC(getOrCreateGraph(*I->second),
                                 Stack, NextID, ValMap);
@@ -412,7 +412,7 @@
 
     // Loop over all potential callees to find the first non-external callee.
     for (TNum = 0, Num = std::distance(I, E); I != E; ++I, ++TNum)
-      if (!I->second->isExternal())
+      if (!I->second->isDeclaration())
         break;
 
     // Now check if the graph has changed and if so, clone and inline it.
@@ -448,7 +448,7 @@
     // same graph as the one inlined above.
     if (CalleeGraph)
       for (++I, ++TNum; I != E; ++I, ++TNum)
-        if (!I->second->isExternal())
+        if (!I->second->isDeclaration())
           assert(CalleeGraph == &getOrCreateGraph(*I->second) &&
                  "Callees at a call site have different graphs?");
 #endif


Index: llvm-poolalloc/lib/DSA/Local.cpp
diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.167 llvm-poolalloc/lib/DSA/Local.cpp:1.168
--- llvm-poolalloc/lib/DSA/Local.cpp:1.167	Mon Jan 22 10:40:38 2007
+++ llvm-poolalloc/lib/DSA/Local.cpp	Fri Feb 23 16:49:32 2007
@@ -246,7 +246,7 @@
     for (DSScalarMap::global_iterator I = ScalarMap.global_begin();
          I != ScalarMap.global_end(); ++I)
       if (GlobalVariable *GV = dyn_cast<GlobalVariable>(*I))
-        if (!GV->isExternal() && GV->isConstant())
+        if (!GV->isDeclaration() && GV->isConstant())
           RC.merge(ScalarMap[GV], GG->ScalarMap[GV]);
   }
 
@@ -495,7 +495,7 @@
 #else
       int FieldNo = CUI->getSExtValue();
 #endif
-      Offset += (unsigned)TD.getStructLayout(STy)->MemberOffsets[FieldNo];
+      Offset += (unsigned)TD.getStructLayout(STy)->getElementOffset(FieldNo);
     } else if (isa<PointerType>(*I)) {
       if (!isa<Constant>(I.getOperand()) ||
           !cast<Constant>(I.getOperand())->isNullValue())
@@ -1430,7 +1430,7 @@
       return;
     }
 #endif
-    if (F->isExternal())
+    if (F->isDeclaration())
       if (F->isIntrinsic() && visitIntrinsic(CS, F))
         return;
       else {
@@ -1581,10 +1581,10 @@
     for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) {
       DSNode *NHN = NH.getNode();
       //Some programmers think ending a structure with a [0 x sbyte] is cute
-      if (SL->MemberOffsets[i] < SL->StructSize) {
-        DSNodeHandle NewNH(NHN, NH.getOffset()+(unsigned)SL->MemberOffsets[i]);
+      if (SL->getElementOffset(i) < SL->getSizeInBytes()) {
+        DSNodeHandle NewNH(NHN, NH.getOffset()+(unsigned)SL->getElementOffset(i));
         MergeConstantInitIntoNode(NewNH, cast<Constant>(CS->getOperand(i)));
-      } else if (SL->MemberOffsets[i] == SL->StructSize) {
+      } else if (SL->getElementOffset(i) == SL->getSizeInBytes()) {
         DOUT << "Zero size element at end of struct\n";
         NHN->foldNodeCompletely();
       } else {
@@ -1599,7 +1599,7 @@
 }
 
 void GraphBuilder::mergeInGlobalInitializer(GlobalVariable *GV) {
-  assert(!GV->isExternal() && "Cannot merge in external global!");
+  assert(!GV->isDeclaration() && "Cannot merge in external global!");
   // Get a node handle to the global node and merge the initializer into it.
   DSNodeHandle NH = getValueDest(*GV);
   MergeConstantInitIntoNode(NH, GV->getInitializer());
@@ -1699,7 +1699,7 @@
     // Add initializers for all of the globals to the globals graph.
     for (Module::global_iterator I = M.global_begin(), E = M.global_end();
          I != E; ++I)
-      if (!I->isExternal())
+      if (!I->isDeclaration())
         GGB.mergeInGlobalInitializer(I);
   }
 
@@ -1712,7 +1712,7 @@
 
   // Calculate all of the graphs...
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal())
+    if (!I->isDeclaration())
       DSInfo.insert(std::make_pair(I, new DSGraph(GlobalECs, TD, *I,
                                                   GlobalsGraph)));
   GlobalsGraph->removeTriviallyDeadNodes();


Index: llvm-poolalloc/lib/DSA/Steensgaard.cpp
diff -u llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.68 llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.69
--- llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.68	Wed Dec 13 23:51:06 2006
+++ llvm-poolalloc/lib/DSA/Steensgaard.cpp	Fri Feb 23 16:49:32 2007
@@ -127,7 +127,7 @@
   // into this graph.
   //
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal())
+    if (!I->isDeclaration())
       ResultGraph->spliceFrom(LDS.getDSGraph(*I));
 
   ResultGraph->removeTriviallyDeadNodes();
@@ -157,7 +157,7 @@
     for (unsigned c = 0; c != CallTargets.size(); ) {
       // If we can eliminate this function call, do so!
       Function *F = CallTargets[c];
-      if (!F->isExternal()) {
+      if (!F->isDeclaration()) {
         ResolveFunctionCall(F, CurCall, ResultGraph->getReturnNodes()[F]);
         CallTargets[c] = CallTargets.back();
         CallTargets.pop_back();
@@ -257,7 +257,7 @@
       // points to a complete node, the external function cannot modify or read
       // the value (we know it's not passed out of the program!).
       if (Function *F = CS.getCalledFunction())
-        if (F->isExternal())
+        if (F->isDeclaration())
           return NoModRef;
 
       // Otherwise, if the node is complete, but it is only M or R, return this.


Index: llvm-poolalloc/lib/DSA/TopDownClosure.cpp
diff -u llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.97 llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.98
--- llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.97	Wed Jan 10 12:10:32 2007
+++ llvm-poolalloc/lib/DSA/TopDownClosure.cpp	Fri Feb 23 16:49:32 2007
@@ -89,7 +89,7 @@
 
   // Functions without internal linkage also have unknown incoming arguments!
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal() && !I->hasInternalLinkage())
+    if (!I->isDeclaration() && !I->hasInternalLinkage())
       ArgsRemainIncomplete.insert(I);
 
   // We want to traverse the call graph in reverse post-order.  To do this, we
@@ -102,7 +102,7 @@
 
   // Visit each of the graphs in reverse post-order now!
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal())
+    if (!I->isDeclaration())
       getOrCreateDSGraph(*I);
   return false;
 }
@@ -112,7 +112,7 @@
 {TIME_REGION(XXX, "td:Compute postorder");
 
   // Calculate top-down from main...
-  if (Function *F = M.getMainFunction())
+  if (Function *F = M.getFunction("main"))
     ComputePostOrder(*F, VisitedGraph, PostOrder);
 
   // Next calculate the graphs for each unreachable function...
@@ -167,7 +167,7 @@
 
 void TDDataStructures::ComputePostOrder(Function &F,hash_set<DSGraph*> &Visited,
                                         std::vector<DSGraph*> &PostOrder) {
-  if (F.isExternal()) return;
+  if (F.isDeclaration()) return;
   DSGraph &G = getOrCreateDSGraph(F);
   if (Visited.count(&G)) return;
   Visited.insert(&G);
@@ -312,7 +312,7 @@
 
     // Handle direct calls efficiently.
     if (CI->isDirectCall()) {
-      if (!CI->getCalleeFunc()->isExternal() &&
+      if (!CI->getCalleeFunc()->isDeclaration() &&
           !DSG.getReturnNodes().count(CI->getCalleeFunc()))
         CallerEdges[&getDSGraph(*CI->getCalleeFunc())]
           .push_back(CallerCallEdge(&DSG, &*CI, CI->getCalleeFunc()));
@@ -341,7 +341,7 @@
     // If there is exactly one callee from this call site, remember the edge in
     // CallerEdges.
     if (IPI == IPE) {
-      if (!FirstCallee->isExternal())
+      if (!FirstCallee->isDeclaration())
         CallerEdges[&getDSGraph(*FirstCallee)]
           .push_back(CallerCallEdge(&DSG, &*CI, FirstCallee));
       continue;
@@ -356,7 +356,7 @@
     for (BUDataStructures::ActualCalleesTy::const_iterator I =
            BUInfo->callee_begin(CallI), E = BUInfo->callee_end(CallI);
          I != E; ++I)
-      if (!I->second->isExternal())
+      if (!I->second->isDeclaration())
         Callees.push_back(I->second);
     std::sort(Callees.begin(), Callees.end());
 






More information about the llvm-commits mailing list