mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-03 08:11:52 +00:00
Allow creating of passes like levelraise which use a targetdata ctor
llvm-svn: 5403
This commit is contained in:
parent
598270f39d
commit
e3b4ef8e1a
@ -13,6 +13,7 @@
|
|||||||
#include "llvm/PassManager.h"
|
#include "llvm/PassManager.h"
|
||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
#include "llvm/Bytecode/WriteBytecodePass.h"
|
#include "llvm/Bytecode/WriteBytecodePass.h"
|
||||||
|
#include "llvm/Target/TargetData.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -60,6 +61,8 @@ void BugDriver::EmitProgressBytecode(const PassInfo *Pass,
|
|||||||
std::cout << " " << Filename << " -" << Pass->getPassArgument() << "\n";
|
std::cout << " " << Filename << " -" << Pass->getPassArgument() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// FIXME: This should be parameterizable!!
|
||||||
|
static TargetData TD("bugpoint target");
|
||||||
|
|
||||||
static void RunChild(Module *Program,const std::vector<const PassInfo*> &Passes,
|
static void RunChild(Module *Program,const std::vector<const PassInfo*> &Passes,
|
||||||
const std::string &OutFilename) {
|
const std::string &OutFilename) {
|
||||||
@ -73,6 +76,8 @@ static void RunChild(Module *Program,const std::vector<const PassInfo*> &Passes,
|
|||||||
for (unsigned i = 0, e = Passes.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Passes.size(); i != e; ++i) {
|
||||||
if (Passes[i]->getNormalCtor())
|
if (Passes[i]->getNormalCtor())
|
||||||
PM.add(Passes[i]->getNormalCtor()());
|
PM.add(Passes[i]->getNormalCtor()());
|
||||||
|
else if (Passes[i]->getDataCtor())
|
||||||
|
PM.add(Passes[i]->getDataCtor()(TD)); // Provide dummy target data...
|
||||||
else
|
else
|
||||||
std::cerr << "Cannot create pass yet: " << Passes[i]->getPassName()
|
std::cerr << "Cannot create pass yet: " << Passes[i]->getPassName()
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user