mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Allow the block extractor take to take a list of basic blocks to not extract
from a file containing Function/BasicBlock pairings. This is not safe against anonymous or abnormally-named Funcs or BBs. Make bugpoint use this interface to pass the BBs list to the child bugpoint. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -124,7 +124,8 @@ int BugDriver::runPassesAsChild(const std::vector<const PassInfo*> &Passes) {
|
||||
///
|
||||
bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
|
||||
std::string &OutputFilename, bool DeleteOutput,
|
||||
bool Quiet) const {
|
||||
bool Quiet, unsigned NumExtraArgs,
|
||||
const char * const *ExtraArgs) const {
|
||||
// setup the output file name
|
||||
cout << std::flush;
|
||||
sys::Path uniqueFilename("bugpoint-output.bc");
|
||||
@@ -156,7 +157,7 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
|
||||
// setup the child process' arguments
|
||||
const char** args = (const char**)
|
||||
alloca(sizeof(const char*) *
|
||||
(Passes.size()+13+2*PluginLoader::getNumPlugins()));
|
||||
(Passes.size()+13+2*PluginLoader::getNumPlugins()+NumExtraArgs));
|
||||
int n = 0;
|
||||
sys::Path tool = sys::Program::FindProgramByName(ToolName);
|
||||
if (UseValgrind) {
|
||||
@@ -182,6 +183,8 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
|
||||
E = pass_args.end(); I != E; ++I )
|
||||
args[n++] = I->c_str();
|
||||
args[n++] = inputFilename.c_str();
|
||||
for (unsigned i = 0; i < NumExtraArgs; ++i)
|
||||
args[n++] = *ExtraArgs;
|
||||
args[n++] = 0;
|
||||
|
||||
sys::Path prog;
|
||||
@@ -225,10 +228,12 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
|
||||
/// failure.
|
||||
Module *BugDriver::runPassesOn(Module *M,
|
||||
const std::vector<const PassInfo*> &Passes,
|
||||
bool AutoDebugCrashes) {
|
||||
bool AutoDebugCrashes, unsigned NumExtraArgs,
|
||||
const char * const *ExtraArgs) {
|
||||
Module *OldProgram = swapProgramIn(M);
|
||||
std::string BitcodeResult;
|
||||
if (runPasses(Passes, BitcodeResult, false/*delete*/, true/*quiet*/)) {
|
||||
if (runPasses(Passes, BitcodeResult, false/*delete*/, true/*quiet*/,
|
||||
NumExtraArgs, ExtraArgs)) {
|
||||
if (AutoDebugCrashes) {
|
||||
cerr << " Error running this sequence of passes"
|
||||
<< " on the input program!\n";
|
||||
|
||||
Reference in New Issue
Block a user