forked from OSchip/llvm-project
fix crashes when we only have a prototype for main.
llvm-svn: 20627
This commit is contained in:
parent
dadf4b369e
commit
21a79edb27
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue