From 49e88e80c78eff3d0bed3874448d4f3049c9be16 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 15 Mar 2005 22:10:04 +0000 Subject: fix crashes when we only have a prototype for main. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20627 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/EquivClassGraphs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Analysis/DataStructure/EquivClassGraphs.cpp') diff --git a/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/lib/Analysis/DataStructure/EquivClassGraphs.cpp index 2ddc684e01..e895ef3c13 100644 --- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp +++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp @@ -106,7 +106,7 @@ bool EquivClassGraphs::runOnModule(Module &M) { // 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) { + if (MainFunc && !MainFunc->isExternal()) { DSGraph &MainGraph = getOrCreateGraph(*MainFunc); const DSGraph &GG = *MainGraph.getGlobalsGraph(); ReachabilityCloner RC(MainGraph, GG, -- cgit v1.2.3-18-g5258