* Convert "\n" -> '\n'

* Print out another '\n' after printing out program execution status
* Make sure code wraps at 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15123 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman 2004-07-23 01:30:49 +00:00
parent 9accb24c89
commit eed80e2375
5 changed files with 21 additions and 20 deletions

View File

@ -79,7 +79,7 @@ Module *llvm::ParseInputFile(const std::string &InputFilename) {
<< InputFilename << "'!\n"; << InputFilename << "'!\n";
} }
} catch (const ParseException &E) { } catch (const ParseException &E) {
std::cerr << "bugpoint: " << E.getMessage() << "\n"; std::cerr << "bugpoint: " << E.getMessage() << '\n';
Result = 0; Result = 0;
} }
return Result; return Result;
@ -107,7 +107,7 @@ bool BugDriver::addSources(const std::vector<std::string> &Filenames) {
std::string ErrorMessage; std::string ErrorMessage;
if (LinkModules(Program, M.get(), &ErrorMessage)) { if (LinkModules(Program, M.get(), &ErrorMessage)) {
std::cerr << ToolName << ": error linking in '" << Filenames[i] << "': " std::cerr << ToolName << ": error linking in '" << Filenames[i] << "': "
<< ErrorMessage << "\n"; << ErrorMessage << '\n';
return true; return true;
} }
} }
@ -143,7 +143,7 @@ bool BugDriver::run() {
std::cout << "Running the code generator to test for a crash: "; std::cout << "Running the code generator to test for a crash: ";
try { try {
compileProgram(Program); compileProgram(Program);
std::cout << "\n"; std::cout << '\n';
} catch (ToolExecutionError &TEE) { } catch (ToolExecutionError &TEE) {
std::cout << TEE.what(); std::cout << TEE.what();
return debugCodeGeneratorCrash(); return debugCodeGeneratorCrash();
@ -160,7 +160,7 @@ bool BugDriver::run() {
try { try {
ReferenceOutputFile = executeProgramWithCBE("bugpoint.reference.out"); ReferenceOutputFile = executeProgramWithCBE("bugpoint.reference.out");
CreatedOutput = true; CreatedOutput = true;
std::cout << "Reference output is: " << ReferenceOutputFile << "\n"; std::cout << "Reference output is: " << ReferenceOutputFile << '\n';
} catch (ToolExecutionError &TEE) { } catch (ToolExecutionError &TEE) {
std::cerr << TEE.what(); std::cerr << TEE.what();
if (Interpreter != cbe) { if (Interpreter != cbe) {

View File

@ -329,7 +329,7 @@ static bool DebugACrash(BugDriver &BD, bool (*TestFn)(BugDriver &, Module *)) {
do { do {
--Simplification; --Simplification;
std::cout << "\n*** Attempting to reduce testcase by deleting instruc" std::cout << "\n*** Attempting to reduce testcase by deleting instruc"
<< "tions: Simplification Level #" << Simplification << "\n"; << "tions: Simplification Level #" << Simplification << '\n';
// Now that we have deleted the functions that are unnecessary for the // Now that we have deleted the functions that are unnecessary for the
// program, try to remove instructions that are not necessary to cause the // program, try to remove instructions that are not necessary to cause the
@ -416,7 +416,7 @@ bool BugDriver::debugOptimizerCrash() {
std::cout << "\n*** Found crashing pass" std::cout << "\n*** Found crashing pass"
<< (PassesToRun.size() == 1 ? ": " : "es: ") << (PassesToRun.size() == 1 ? ": " : "es: ")
<< getPassesString(PassesToRun) << "\n"; << getPassesString(PassesToRun) << '\n';
EmitProgressBytecode("passinput"); EmitProgressBytecode("passinput");
@ -425,8 +425,9 @@ bool BugDriver::debugOptimizerCrash() {
static bool TestForCodeGenCrash(BugDriver &BD, Module *M) { static bool TestForCodeGenCrash(BugDriver &BD, Module *M) {
try { try {
std::cerr << "\n"; std::cerr << '\n';
BD.compileProgram(M); BD.compileProgram(M);
std::cerr << '\n';
return false; return false;
} catch (ToolExecutionError &TEE) { } catch (ToolExecutionError &TEE) {
std::cerr << "<crash>\n"; std::cerr << "<crash>\n";

View File

@ -42,7 +42,7 @@ namespace {
cl::opt<bool> cl::opt<bool>
CheckProgramExitCode("check-exit-code", CheckProgramExitCode("check-exit-code",
cl::desc("Assume nonzero exit code is failure (default on)"), cl::desc("Assume nonzero exit code is failure (default on)"),
cl::init(true)); cl::init(true));
cl::opt<std::string> cl::opt<std::string>
@ -279,7 +279,7 @@ bool BugDriver::diffProgram(const std::string &BytecodeFile,
bool FilesDifferent = false; bool FilesDifferent = false;
if (DiffFiles(ReferenceOutputFile, Output, &Error)) { if (DiffFiles(ReferenceOutputFile, Output, &Error)) {
if (!Error.empty()) { if (!Error.empty()) {
std::cerr << "While diffing output: " << Error << "\n"; std::cerr << "While diffing output: " << Error << '\n';
exit(1); exit(1);
} }
FilesDifferent = true; FilesDifferent = true;

View File

@ -174,7 +174,7 @@ static bool TestMergedProgram(BugDriver &BD, Module *M1, Module *M2,
if (!DeleteInputs) M1 = CloneModule(M1); if (!DeleteInputs) M1 = CloneModule(M1);
if (LinkModules(M1, M2, &ErrorMsg)) { if (LinkModules(M1, M2, &ErrorMsg)) {
std::cerr << BD.getToolName() << ": Error linking modules together:" std::cerr << BD.getToolName() << ": Error linking modules together:"
<< ErrorMsg << "\n"; << ErrorMsg << '\n';
exit(1); exit(1);
} }
if (DeleteInputs) delete M2; // We are done with this module... if (DeleteInputs) delete M2; // We are done with this module...
@ -203,7 +203,7 @@ bool ReduceMiscompilingFunctions::TestFuncs(const std::vector<Function*>&Funcs){
<< " run through the pass" << " run through the pass"
<< (BD.getPassesToRun().size() == 1 ? "" : "es") << ":"; << (BD.getPassesToRun().size() == 1 ? "" : "es") << ":";
PrintFunctionList(Funcs); PrintFunctionList(Funcs);
std::cout << "\n"; std::cout << '\n';
// Split the module into the two halves of the program we want. // Split the module into the two halves of the program we want.
Module *ToNotOptimize = CloneModule(BD.getProgram()); Module *ToNotOptimize = CloneModule(BD.getProgram());
@ -296,7 +296,7 @@ static bool ExtractLoops(BugDriver &BD,
std::string ErrorMsg; std::string ErrorMsg;
if (LinkModules(ToNotOptimize, ToOptimizeLoopExtracted, &ErrorMsg)) { if (LinkModules(ToNotOptimize, ToOptimizeLoopExtracted, &ErrorMsg)) {
std::cerr << BD.getToolName() << ": Error linking modules together:" std::cerr << BD.getToolName() << ": Error linking modules together:"
<< ErrorMsg << "\n"; << ErrorMsg << '\n';
exit(1); exit(1);
} }
@ -359,7 +359,7 @@ bool ReduceMiscompiledBlocks::TestFuncs(const std::vector<BasicBlock*> &BBs) {
} else { } else {
std::cout << "blocks are extracted."; std::cout << "blocks are extracted.";
} }
std::cout << "\n"; std::cout << '\n';
// Split the module into the two halves of the program we want. // Split the module into the two halves of the program we want.
Module *ToNotOptimize = CloneModule(BD.getProgram()); Module *ToNotOptimize = CloneModule(BD.getProgram());
@ -426,7 +426,7 @@ static bool ExtractBlocks(BugDriver &BD,
std::string ErrorMsg; std::string ErrorMsg;
if (LinkModules(ProgClone, Extracted, &ErrorMsg)) { if (LinkModules(ProgClone, Extracted, &ErrorMsg)) {
std::cerr << BD.getToolName() << ": Error linking modules together:" std::cerr << BD.getToolName() << ": Error linking modules together:"
<< ErrorMsg << "\n"; << ErrorMsg << '\n';
exit(1); exit(1);
} }
@ -473,7 +473,7 @@ DebugAMiscompilation(BugDriver &BD,
<< (MiscompiledFunctions.size() == 1 ? " is" : "s are") << (MiscompiledFunctions.size() == 1 ? " is" : "s are")
<< " being miscompiled: "; << " being miscompiled: ";
PrintFunctionList(MiscompiledFunctions); PrintFunctionList(MiscompiledFunctions);
std::cout << "\n"; std::cout << '\n';
// See if we can rip any loops out of the miscompiled functions and still // See if we can rip any loops out of the miscompiled functions and still
// trigger the problem. // trigger the problem.
@ -493,7 +493,7 @@ DebugAMiscompilation(BugDriver &BD,
<< (MiscompiledFunctions.size() == 1 ? " is" : "s are") << (MiscompiledFunctions.size() == 1 ? " is" : "s are")
<< " being miscompiled: "; << " being miscompiled: ";
PrintFunctionList(MiscompiledFunctions); PrintFunctionList(MiscompiledFunctions);
std::cout << "\n"; std::cout << '\n';
} }
if (ExtractBlocks(BD, TestFn, MiscompiledFunctions)) { if (ExtractBlocks(BD, TestFn, MiscompiledFunctions)) {
@ -512,7 +512,7 @@ DebugAMiscompilation(BugDriver &BD,
<< (MiscompiledFunctions.size() == 1 ? " is" : "s are") << (MiscompiledFunctions.size() == 1 ? " is" : "s are")
<< " being miscompiled: "; << " being miscompiled: ";
PrintFunctionList(MiscompiledFunctions); PrintFunctionList(MiscompiledFunctions);
std::cout << "\n"; std::cout << '\n';
} }
return MiscompiledFunctions; return MiscompiledFunctions;
@ -552,7 +552,7 @@ bool BugDriver::debugMiscompilation() {
std::cout << "\n*** Found miscompiling pass" std::cout << "\n*** Found miscompiling pass"
<< (getPassesToRun().size() == 1 ? "" : "es") << ": " << (getPassesToRun().size() == 1 ? "" : "es") << ": "
<< getPassesString(getPassesToRun()) << "\n"; << getPassesString(getPassesToRun()) << '\n';
EmitProgressBytecode("passinput"); EmitProgressBytecode("passinput");
std::vector<Function*> MiscompiledFunctions = std::vector<Function*> MiscompiledFunctions =
@ -807,7 +807,7 @@ bool BugDriver::debugCodeGenerator() {
} }
for (unsigned i=0, e = InputArgv.size(); i != e; ++i) for (unsigned i=0, e = InputArgv.size(); i != e; ++i)
std::cout << " " << InputArgv[i]; std::cout << " " << InputArgv[i];
std::cout << "\n"; std::cout << '\n';
std::cout << "The shared object was created with:\n llc -march=c " std::cout << "The shared object was created with:\n llc -march=c "
<< SafeModuleBC << " -o temporary.c\n" << SafeModuleBC << " -o temporary.c\n"
<< " gcc -xc temporary.c -O2 -o " << SharedObject << " gcc -xc temporary.c -O2 -o " << SharedObject

View File

@ -57,7 +57,7 @@ int main(int argc, char **argv) {
try { try {
return D.run(); return D.run();
} catch (ToolExecutionError &TEE) { } catch (ToolExecutionError &TEE) {
std::cerr << "Tool execution error: " << TEE.what() << "\n"; std::cerr << "Tool execution error: " << TEE.what() << '\n';
return 1; return 1;
} catch (...) { } catch (...) {
std::cerr << "Whoops, an exception leaked out of bugpoint. " std::cerr << "Whoops, an exception leaked out of bugpoint. "