mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
42815c8fc3
commit
5d5b6d6a5c
@ -7,10 +7,10 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "DSCallSiteIterator.h"
|
|
||||||
#include "llvm/Analysis/DataStructure.h"
|
#include "llvm/Analysis/DataStructure.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
#include "DSCallSiteIterator.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph");
|
Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph");
|
||||||
@ -35,7 +35,7 @@ bool BUDataStructures::run(Module &M) {
|
|||||||
|
|
||||||
// Calculate the graphs for any functions that are unreachable from main...
|
// Calculate the graphs for any functions that are unreachable from main...
|
||||||
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
|
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
|
||||||
if (!I->isExternal() && DSInfo.find(I) == DSInfo.end()) {
|
if (!I->isExternal() && !DSInfo.count(I)) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (MainFunc)
|
if (MainFunc)
|
||||||
std::cerr << "*** Function unreachable from main: "
|
std::cerr << "*** Function unreachable from main: "
|
||||||
@ -233,6 +233,7 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
|
|||||||
// Resolve the current call...
|
// Resolve the current call...
|
||||||
Function *Callee = *I;
|
Function *Callee = *I;
|
||||||
const DSCallSite &CS = I.getCallSite();
|
const DSCallSite &CS = I.getCallSite();
|
||||||
|
ActualCallees.insert(std::make_pair(&CS.getCallInst(), Callee));
|
||||||
|
|
||||||
if (Callee->isExternal()) {
|
if (Callee->isExternal()) {
|
||||||
// Ignore this case, simple varargs functions we cannot stub out!
|
// Ignore this case, simple varargs functions we cannot stub out!
|
||||||
@ -251,8 +252,8 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
|
|||||||
|
|
||||||
DEBUG(std::cerr << " Inlining graph for " << Callee->getName()
|
DEBUG(std::cerr << " Inlining graph for " << Callee->getName()
|
||||||
<< "[" << GI.getGraphSize() << "+"
|
<< "[" << GI.getGraphSize() << "+"
|
||||||
<< GI.getAuxFunctionCalls().size() << "] into ["
|
<< GI.getAuxFunctionCalls().size() << "] into '"
|
||||||
<< Graph.getGraphSize() << "+"
|
<< Graph.getFunctionNames() << "' [" << Graph.getGraphSize() << "+"
|
||||||
<< Graph.getAuxFunctionCalls().size() << "]\n");
|
<< Graph.getAuxFunctionCalls().size() << "]\n");
|
||||||
|
|
||||||
// Handle self recursion by resolving the arguments and return value
|
// Handle self recursion by resolving the arguments and return value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user