mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Finegrainify namespacification
'Pass' should now not be derived from by clients. Instead, they should derive from ModulePass. Instead of implementing Pass::run, then should implement ModulePass::runOnModule. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16434 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -31,8 +31,7 @@
|
|||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/ADT/SCCIterator.h"
|
#include "llvm/ADT/SCCIterator.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct CFGSCC : public FunctionPass {
|
struct CFGSCC : public FunctionPass {
|
||||||
@ -45,9 +44,9 @@ namespace {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CallGraphSCC : public Pass {
|
struct CallGraphSCC : public ModulePass {
|
||||||
// run - Print out SCCs in the call graph for the specified module.
|
// run - Print out SCCs in the call graph for the specified module.
|
||||||
bool run(Module &M);
|
bool runOnModule(Module &M);
|
||||||
|
|
||||||
void print(std::ostream &O) const { }
|
void print(std::ostream &O) const { }
|
||||||
|
|
||||||
@ -85,7 +84,7 @@ bool CFGSCC::runOnFunction(Function &F) {
|
|||||||
|
|
||||||
|
|
||||||
// run - Print out SCCs in the call graph for the specified module.
|
// run - Print out SCCs in the call graph for the specified module.
|
||||||
bool CallGraphSCC::run(Module &M) {
|
bool CallGraphSCC::runOnModule(Module &M) {
|
||||||
CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
|
CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
|
||||||
unsigned sccNum = 0;
|
unsigned sccNum = 0;
|
||||||
std::cout << "SCCs for the program in PostOrder:";
|
std::cout << "SCCs for the program in PostOrder:";
|
||||||
@ -104,5 +103,3 @@ bool CallGraphSCC::run(Module &M) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -31,8 +31,7 @@
|
|||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/ADT/SCCIterator.h"
|
#include "llvm/ADT/SCCIterator.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct CFGSCC : public FunctionPass {
|
struct CFGSCC : public FunctionPass {
|
||||||
@ -45,9 +44,9 @@ namespace {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CallGraphSCC : public Pass {
|
struct CallGraphSCC : public ModulePass {
|
||||||
// run - Print out SCCs in the call graph for the specified module.
|
// run - Print out SCCs in the call graph for the specified module.
|
||||||
bool run(Module &M);
|
bool runOnModule(Module &M);
|
||||||
|
|
||||||
void print(std::ostream &O) const { }
|
void print(std::ostream &O) const { }
|
||||||
|
|
||||||
@ -85,7 +84,7 @@ bool CFGSCC::runOnFunction(Function &F) {
|
|||||||
|
|
||||||
|
|
||||||
// run - Print out SCCs in the call graph for the specified module.
|
// run - Print out SCCs in the call graph for the specified module.
|
||||||
bool CallGraphSCC::run(Module &M) {
|
bool CallGraphSCC::runOnModule(Module &M) {
|
||||||
CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
|
CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
|
||||||
unsigned sccNum = 0;
|
unsigned sccNum = 0;
|
||||||
std::cout << "SCCs for the program in PostOrder:";
|
std::cout << "SCCs for the program in PostOrder:";
|
||||||
@ -104,5 +103,3 @@ bool CallGraphSCC::run(Module &M) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -31,8 +31,7 @@
|
|||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/ADT/SCCIterator.h"
|
#include "llvm/ADT/SCCIterator.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct CFGSCC : public FunctionPass {
|
struct CFGSCC : public FunctionPass {
|
||||||
@ -45,9 +44,9 @@ namespace {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CallGraphSCC : public Pass {
|
struct CallGraphSCC : public ModulePass {
|
||||||
// run - Print out SCCs in the call graph for the specified module.
|
// run - Print out SCCs in the call graph for the specified module.
|
||||||
bool run(Module &M);
|
bool runOnModule(Module &M);
|
||||||
|
|
||||||
void print(std::ostream &O) const { }
|
void print(std::ostream &O) const { }
|
||||||
|
|
||||||
@ -85,7 +84,7 @@ bool CFGSCC::runOnFunction(Function &F) {
|
|||||||
|
|
||||||
|
|
||||||
// run - Print out SCCs in the call graph for the specified module.
|
// run - Print out SCCs in the call graph for the specified module.
|
||||||
bool CallGraphSCC::run(Module &M) {
|
bool CallGraphSCC::runOnModule(Module &M) {
|
||||||
CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
|
CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
|
||||||
unsigned sccNum = 0;
|
unsigned sccNum = 0;
|
||||||
std::cout << "SCCs for the program in PostOrder:";
|
std::cout << "SCCs for the program in PostOrder:";
|
||||||
@ -104,5 +103,3 @@ bool CallGraphSCC::run(Module &M) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
Reference in New Issue
Block a user