mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Allow disabling final cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6271 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -26,6 +26,9 @@ namespace {
|
|||||||
cl::opt<bool>
|
cl::opt<bool>
|
||||||
NoSCFG("disable-simplifycfg",
|
NoSCFG("disable-simplifycfg",
|
||||||
cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
|
cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
|
||||||
|
cl::opt<bool>
|
||||||
|
NoFinalCleanup("disable-final-cleanup",
|
||||||
|
cl::desc("Disable the final cleanup phase of narrowing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// deleteInstructionFromProgram - This method clones the current Program and
|
/// deleteInstructionFromProgram - This method clones the current Program and
|
||||||
@@ -79,10 +82,17 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I,
|
|||||||
Module *BugDriver::performFinalCleanups() const {
|
Module *BugDriver::performFinalCleanups() const {
|
||||||
Module *M = CloneModule(Program);
|
Module *M = CloneModule(Program);
|
||||||
|
|
||||||
|
// Allow disabling these passes if they crash bugpoint.
|
||||||
|
//
|
||||||
|
// FIXME: This should eventually run these passes in a pass list to prevent
|
||||||
|
// them from being able to crash bugpoint at all!
|
||||||
|
//
|
||||||
|
if (NoFinalCleanup) return M;
|
||||||
|
|
||||||
// Make all functions external, so GlobalDCE doesn't delete them...
|
// Make all functions external, so GlobalDCE doesn't delete them...
|
||||||
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
|
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
|
||||||
I->setLinkage(GlobalValue::ExternalLinkage);
|
I->setLinkage(GlobalValue::ExternalLinkage);
|
||||||
|
|
||||||
PassManager CleanupPasses;
|
PassManager CleanupPasses;
|
||||||
CleanupPasses.add(createFunctionResolvingPass());
|
CleanupPasses.add(createFunctionResolvingPass());
|
||||||
CleanupPasses.add(createGlobalDCEPass());
|
CleanupPasses.add(createGlobalDCEPass());
|
||||||
|
Reference in New Issue
Block a user