llvm.org GIT mirror llvm / 56584fc
Fix whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128631 91177308-0d34-0410-b5e6-96231b3b80d8 Michael J. Spencer 9 years ago
3 changed file(s) with 24 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
2121
2222 /// DiffFilesWithTolerance - Compare the two files specified, returning 0 if
2323 /// the files match, 1 if they are different, and 2 if there is a file error.
24 /// This function allows you to specify an absolete and relative FP error that
24 /// This function allows you to specify an absolute and relative FP error that
2525 /// is allowed to exist. If you specify a string to fill in for the error
2626 /// option, it will set the string to an error message if an error occurs, or
2727 /// if the files are different.
7070 LLVMContext& ctxt)
7171 : Context(ctxt), ToolName(toolname), ReferenceOutputFile(OutputFile),
7272 Program(0), Interpreter(0), SafeInterpreter(0), gcc(0),
73 run_find_bugs(find_bugs), Timeout(timeout),
73 run_find_bugs(find_bugs), Timeout(timeout),
7474 MemoryLimit(memlimit), UseValgrind(use_valgrind) {}
7575
7676 BugDriver::~BugDriver() {
9696
9797 if (TheTriple.getTriple().empty())
9898 TheTriple.setTriple(sys::getHostTriple());
99
99
100100 TargetTriple.setTriple(TheTriple.getTriple());
101101 }
102102
117117 // Load the first input file.
118118 Program = ParseInputFile(Filenames[0], Context);
119119 if (Program == 0) return true;
120
120
121121 outs() << "Read input file : '" << Filenames[0] << "'\n";
122122
123123 for (unsigned i = 1, e = Filenames.size(); i != e; ++i) {
151151 return runManyPasses(PassesToRun, ErrMsg);
152152 }
153153
154 // If we're not running as a child, the first thing that we must do is
155 // determine what the problem is. Does the optimization series crash the
156 // compiler, or does it produce illegal code? We make the top-level
157 // decision by trying to run all of the passes on the the input program,
158 // which should generate a bitcode file. If it does generate a bitcode
159 // file, then we know the compiler didn't crash, so try to diagnose a
154 // If we're not running as a child, the first thing that we must do is
155 // determine what the problem is. Does the optimization series crash the
156 // compiler, or does it produce illegal code? We make the top-level
157 // decision by trying to run all of the passes on the the input program,
158 // which should generate a bitcode file. If it does generate a bitcode
159 // file, then we know the compiler didn't crash, so try to diagnose a
160160 // miscompilation.
161161 if (!PassesToRun.empty()) {
162162 outs() << "Running selected passes on program to test for crash: ";
196196 FileRemover RemoverInstance(ROF.str(), CreatedOutput && !SaveTemps);
197197
198198 // Diff the output of the raw program against the reference output. If it
199 // matches, then we assume there is a miscompilation bug and try to
199 // matches, then we assume there is a miscompilation bug and try to
200200 // diagnose it.
201201 outs() << "*** Checking the code generator...\n";
202202 bool Diff = diffProgram(Program, "", "", false, &Error);
3333 }
3434
3535 namespace {
36 static llvm::cl::opt
37 DisableLoopExtraction("disable-loop-extraction",
36 static llvm::cl::opt
37 DisableLoopExtraction("disable-loop-extraction",
3838 cl::desc("Don't extract loops when searching for miscompilations"),
3939 cl::init(false));
40 static llvm::cl::opt
41 DisableBlockExtraction("disable-block-extraction",
40 static llvm::cl::opt
41 DisableBlockExtraction("disable-block-extraction",
4242 cl::desc("Don't extract blocks when searching for miscompilations"),
4343 cl::init(false));
4444
7474 BD.EmitProgressBitcode(BD.getProgram(), "pass-error", false);
7575 exit(BD.debugOptimizerCrash());
7676 }
77
77
7878 // Check to see if the finished program matches the reference output...
7979 bool Diff = BD.diffProgram(BD.getProgram(), BitcodeResult, "",
8080 true /*delete bitcode*/, &Error);
308308 bool MadeChange = false;
309309 while (1) {
310310 if (BugpointIsInterrupted) return MadeChange;
311
311
312312 ValueToValueMapTy VMap;
313313 Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap);
314314 Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize,
353353 BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to-le.bc",
354354 ToOptimizeLoopExtracted);
355355
356 errs() << "Please submit the "
356 errs() << "Please submit the "
357357 << OutputPrefix << "-loop-extract-fail-*.bc files.\n";
358358 delete ToOptimize;
359359 delete ToNotOptimize;
408408 MiscompiledFunctions.clear();
409409 for (unsigned i = 0, e = MisCompFunctions.size(); i != e; ++i) {
410410 Function *NewF = ToNotOptimize->getFunction(MisCompFunctions[i].first);
411
411
412412 assert(NewF && "Function not found??");
413 assert(NewF->getFunctionType() == MisCompFunctions[i].second &&
413 assert(NewF->getFunctionType() == MisCompFunctions[i].second &&
414414 "found wrong function type?");
415415 MiscompiledFunctions.push_back(NewF);
416416 }
522522 std::vector &MiscompiledFunctions,
523523 std::string &Error) {
524524 if (BugpointIsInterrupted) return false;
525
525
526526 std::vector Blocks;
527527 for (unsigned i = 0, e = MiscompiledFunctions.size(); i != e; ++i)
528528 for (Function::iterator I = MiscompiledFunctions[i]->begin(),
592592 for (unsigned i = 0, e = MisCompFunctions.size(); i != e; ++i) {
593593 Function *NewF = ProgClone->getFunction(MisCompFunctions[i].first);
594594 assert(NewF && "Function not found??");
595 assert(NewF->getFunctionType() == MisCompFunctions[i].second &&
595 assert(NewF->getFunctionType() == MisCompFunctions[i].second &&
596596 "Function has wrong type??");
597597 MiscompiledFunctions.push_back(NewF);
598598 }
730730 << getPassesString(getPassesToRun()) << '\n';
731731 EmitProgressBitcode(Program, "passinput");
732732
733 std::vector MiscompiledFunctions =
733 std::vector MiscompiledFunctions =
734734 DebugAMiscompilation(*this, TestOptimizer, *Error);
735735 if (!Error->empty())
736736 return;
844844 // Create a new global to hold the cached function pointer.
845845 Constant *NullPtr = ConstantPointerNull::get(F->getType());
846846 GlobalVariable *Cache =
847 new GlobalVariable(*F->getParent(), F->getType(),
847 new GlobalVariable(*F->getParent(), F->getType(),
848848 false, GlobalValue::InternalLinkage,
849849 NullPtr,F->getName()+".fpcache");
850850