diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-29 19:16:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-29 19:16:59 +0000 |
commit | 9342a939eb0aac1f08e2799de33880b7061d3590 (patch) | |
tree | 2eefc0871c288066f78140185dc842e2d93d55d7 /lib/Analysis/DataStructure/Steensgaard.cpp | |
parent | f51d3bd6769d46e7cf7beaa283d1ca449629bd32 (diff) |
Fix a problem where we not marking incoming arguments to functions with
external linkage as incomplete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Steensgaard.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/Steensgaard.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp index aa7f54b890..747ae2fc4b 100644 --- a/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/lib/Analysis/DataStructure/Steensgaard.cpp @@ -167,14 +167,22 @@ bool Steens::runOnModule(Module &M) { } } - // Remove our knowledge of what the return values of the functions are. - ResultGraph->getReturnNodes().clear(); + // Remove our knowledge of what the return values of the functions are, except + // for functions that are externally visible from this module (e.g. main). We + // keep these functions so that their arguments are marked incomplete. + for (DSGraph::ReturnNodesTy::iterator I = + ResultGraph->getReturnNodes().begin(), + E = ResultGraph->getReturnNodes().end(); I != E; ) + if (I->first->hasInternalLinkage()) + ResultGraph->getReturnNodes().erase(I++); + else + ++I; // Update the "incomplete" markers on the nodes, ignoring unknownness due to // incoming arguments... ResultGraph->maskIncompleteMarkers(); - ResultGraph->markIncompleteNodes(DSGraph::IgnoreFormalArgs | - DSGraph::IgnoreGlobals); + ResultGraph->markIncompleteNodes(DSGraph::IgnoreGlobals | + DSGraph::MarkFormalArgs); // Remove any nodes that are dead after all of the merging we have done... // FIXME: We should be able to disable the globals graph for steens! |