Lines Matching refs:BD

61     BugDriver &BD;  member in llvm::ReducePassList
63 ReducePassList(BugDriver &bd) : BD(bd) {} in ReducePassList()
84 if (BD.runPasses(BD.getProgram(), Prefix, PrefixOutput)) in doTest()
87 OrigProgram = BD.Program; in doTest()
89 BD.Program = parseInputFile(PrefixOutput, BD.getContext()).release(); in doTest()
90 if (BD.Program == nullptr) { in doTest()
91 errs() << BD.getToolName() << ": Error reading bitcode file '" in doTest()
101 if (BD.runPasses(BD.getProgram(), Suffix)) { in doTest()
108 delete BD.Program; in doTest()
109 BD.Program = OrigProgram; in doTest()
120 BugDriver &BD; member in __anon692caeb90211::ReduceCrashingGlobalVariables
125 : BD(bd), TestFn(testFn) {} in ReduceCrashingGlobalVariables()
146 Module *M = CloneModule(BD.getProgram(), VMap).release(); in TestGlobalVariables()
171 if (TestFn(BD, M)) { in TestGlobalVariables()
172 BD.setNewProgram(M); // It crashed, keep the trimmed version... in TestGlobalVariables()
190 BugDriver &BD; member in __anon692caeb90311::ReduceCrashingFunctions
195 : BD(bd), TestFn(testFn) {} in ReduceCrashingFunctions()
237 BD.getProgram()->getFunction("main")) == in TestFuncs()
243 Module *M = CloneModule(BD.getProgram(), VMap).release(); in TestFuncs()
306 if (TestFn(BD, M)) { in TestFuncs()
307 BD.setNewProgram(M); // It crashed, keep the trimmed version... in TestFuncs()
326 BugDriver &BD; member in __anon692caeb90411::ReduceCrashingBlocks
331 : BD(bd), TestFn(testFn) {} in ReduceCrashingBlocks()
350 Module *M = CloneModule(BD.getProgram(), VMap).release(); in TestBlocks()
401 std::unique_ptr<Module> New = BD.runPassesOn(M, Passes); in TestBlocks()
410 if (TestFn(BD, M)) { in TestBlocks()
411 BD.setNewProgram(M); // It crashed, keep the trimmed version... in TestBlocks()
435 BugDriver &BD; member in __anon692caeb90511::ReduceCrashingInstructions
440 : BD(bd), TestFn(testFn) {} in ReduceCrashingInstructions()
460 Module *M = CloneModule(BD.getProgram(), VMap).release(); in TestInsts()
493 if (TestFn(BD, M)) { in TestInsts()
494 BD.setNewProgram(M); // It crashed, keep the trimmed version... in TestInsts()
511 BugDriver &BD; member in __anon692caeb90611::ReduceCrashingNamedMD
517 : BD(bd), TestFn(testFn) {} in ReduceCrashingNamedMD()
536 Module *M = CloneModule(BD.getProgram(), VMap).release(); in TestNamedMDs()
570 if (TestFn(BD, M)) { in TestNamedMDs()
571 BD.setNewProgram(M); // It crashed, keep the trimmed version... in TestNamedMDs()
581 BugDriver &BD; member in __anon692caeb90711::ReduceCrashingNamedMDOps
587 : BD(bd), TestFn(testFn) {} in ReduceCrashingNamedMDOps()
618 Module *M = CloneModule(BD.getProgram(), VMap).release(); in TestNamedMDOps()
622 for (auto &NamedMD : BD.getProgram()->named_metadata()) { in TestNamedMDOps()
638 if (TestFn(BD, M)) { in TestNamedMDOps()
645 BD.setNewProgram(M); // It crashed, keep the trimmed version... in TestNamedMDOps()
652 static void ReduceGlobalInitializers(BugDriver &BD, in ReduceGlobalInitializers() argument
655 if (BD.getProgram()->global_begin() != BD.getProgram()->global_end()) { in ReduceGlobalInitializers()
658 Module *M = CloneModule(BD.getProgram()).release(); in ReduceGlobalInitializers()
676 if (TestFn(BD, M)) { // Still crashes? in ReduceGlobalInitializers()
677 BD.setNewProgram(M); in ReduceGlobalInitializers()
685 for (Module::global_iterator I = BD.getProgram()->global_begin(), in ReduceGlobalInitializers()
686 E = BD.getProgram()->global_end(); I != E; ++I) in ReduceGlobalInitializers()
695 ReduceCrashingGlobalVariables(BD, TestFn).reduceList(GVs, Error); in ReduceGlobalInitializers()
699 BD.EmitProgressBitcode(BD.getProgram(), "reduced-global-variables"); in ReduceGlobalInitializers()
706 static void ReduceInsts(BugDriver &BD, in ReduceInsts() argument
713 for (const Function &F : *BD.getProgram()) in ReduceInsts()
719 ReduceCrashingInstructions(BD, TestFn).reduceList(Insts, Error); in ReduceInsts()
744 for (Module::const_iterator FI = BD.getProgram()->begin(), in ReduceInsts()
745 E = BD.getProgram()->end(); FI != E; ++FI) in ReduceInsts()
762 BD.deleteInstructionFromProgram(&*I, Simplification); in ReduceInsts()
765 if (TestFn(BD, M.get())) { in ReduceInsts()
768 BD.setNewProgram(M.release()); in ReduceInsts()
781 BD.EmitProgressBitcode(BD.getProgram(), "reduced-instructions"); in ReduceInsts()
788 static bool DebugACrash(BugDriver &BD, in DebugACrash() argument
794 ReduceGlobalInitializers(BD, TestFn, Error); in DebugACrash()
798 for (Function &F : *BD.getProgram()) in DebugACrash()
807 ReduceCrashingFunctions(BD, TestFn).reduceList(Functions, Error); in DebugACrash()
810 BD.EmitProgressBitcode(BD.getProgram(), "reduced-function"); in DebugACrash()
820 for (Function &F : *BD.getProgram()) in DebugACrash()
824 ReduceCrashingBlocks(BD, TestFn).reduceList(Blocks, Error); in DebugACrash()
826 BD.EmitProgressBitcode(BD.getProgram(), "reduced-blocks"); in DebugACrash()
832 ReduceInsts(BD, TestFn, Error); in DebugACrash()
840 for (auto &NamedMD : BD.getProgram()->named_metadata()) in DebugACrash()
842 ReduceCrashingNamedMD(BD, TestFn).reduceList(NamedMDNames, Error); in DebugACrash()
849 for (auto &NamedMD : BD.getProgram()->named_metadata()) in DebugACrash()
852 ReduceCrashingNamedMDOps(BD, TestFn).reduceList(NamedMDOps, Error); in DebugACrash()
854 BD.EmitProgressBitcode(BD.getProgram(), "reduced-named-md"); in DebugACrash()
860 Module *M = CloneModule(BD.getProgram()).release(); in DebugACrash()
861 M = BD.performFinalCleanups(M, true).release(); in DebugACrash()
864 if (TestFn(BD, M)) { in DebugACrash()
865 BD.setNewProgram(M); // Yup, it does, keep the reduced version... in DebugACrash()
871 BD.EmitProgressBitcode(BD.getProgram(), "reduced-simplified"); in DebugACrash()
876 static bool TestForOptimizerCrash(const BugDriver &BD, Module *M) { in TestForOptimizerCrash() argument
877 return BD.runPasses(M, BD.getPassesToRun()); in TestForOptimizerCrash()
904 static bool TestForCodeGenCrash(const BugDriver &BD, Module *M) { in TestForCodeGenCrash() argument
906 BD.compileProgram(M, &Error); in TestForCodeGenCrash()