fix crashes when we only have a prototype for main.
authorChris Lattner <sabre@nondot.org>
Tue, 15 Mar 2005 22:10:04 +0000 (22:10 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 15 Mar 2005 22:10:04 +0000 (22:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20627 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/BottomUpClosure.cpp
lib/Analysis/DataStructure/CompleteBottomUp.cpp
lib/Analysis/DataStructure/EquivClassGraphs.cpp

index 6c26602889cf99f5347c44826f40a56e12c8ee3f..91cfc7c14ebc26a2817d744d868536ee6e220847 100644 (file)
@@ -85,7 +85,7 @@ bool BUDataStructures::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, 
index 4dcfc354833e026b0f289ad5d126a2086eea7808..5a0436c0616b54d69aaa7db4e46a967edbd114cf 100644 (file)
@@ -94,7 +94,7 @@ bool CompleteBUDataStructures::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, 
index 2ddc684e0104788eb101e9fbd2a54ea3ac3efea8..e895ef3c13559b99402ba7fa113ee87a1cafad7a 100644 (file)
@@ -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,