mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-21 12:38:45 +00:00
finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12221 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
63a225050f
commit
c51733c7b5
@ -7,7 +7,9 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This inserts a global constant table with function pointers all along
|
// This inserts a global constant table with function pointers all along.
|
||||||
|
//
|
||||||
|
// NOTE: This pass is used by the reoptimizer only.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
@ -16,24 +18,24 @@
|
|||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
enum Color{
|
|
||||||
WHITE,
|
|
||||||
GREY,
|
|
||||||
BLACK
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
enum Color{
|
||||||
|
WHITE,
|
||||||
|
GREY,
|
||||||
|
BLACK
|
||||||
|
};
|
||||||
|
|
||||||
struct EmitFunctionTable : public Pass {
|
struct EmitFunctionTable : public Pass {
|
||||||
bool run(Module &M);
|
bool run(Module &M);
|
||||||
};
|
};
|
||||||
|
|
||||||
RegisterOpt<EmitFunctionTable> X("emitfuncs", "Emit a Function Table");
|
RegisterOpt<EmitFunctionTable>
|
||||||
|
X("emitfuncs", "Emit a function table for the reoptimizer");
|
||||||
}
|
}
|
||||||
|
|
||||||
char doDFS(BasicBlock * node,std::map<BasicBlock *, Color > &color){
|
static char doDFS(BasicBlock * node,std::map<BasicBlock *, Color > &color){
|
||||||
color[node] = GREY;
|
color[node] = GREY;
|
||||||
|
|
||||||
for(succ_iterator vl = succ_begin(node), ve = succ_end(node); vl != ve; ++vl){
|
for(succ_iterator vl = succ_begin(node), ve = succ_end(node); vl != ve; ++vl){
|
||||||
@ -56,7 +58,7 @@ char doDFS(BasicBlock * node,std::map<BasicBlock *, Color > &color){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char hasBackEdge(Function *F){
|
static char hasBackEdge(Function *F){
|
||||||
std::map<BasicBlock *, Color > color;
|
std::map<BasicBlock *, Color > color;
|
||||||
return doDFS(F->begin(), color);
|
return doDFS(F->begin(), color);
|
||||||
}
|
}
|
||||||
@ -106,5 +108,3 @@ bool EmitFunctionTable::run(Module &M){
|
|||||||
M.getGlobalList().push_back(fnCount);
|
M.getGlobalList().push_back(fnCount);
|
||||||
return true; // Always modifies program
|
return true; // Always modifies program
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user