diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-23 22:45:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-23 22:45:37 +0000 |
commit | 74382b7c699120fbec5cb5603c9cf4212eb37f06 (patch) | |
tree | c8c2c5b8879b256c428b0d35841b9cce1c2cc51c /tools/bugpoint/Miscompilation.cpp | |
parent | 983c592272eb59d39fd78c515e1f2701638879e0 (diff) | |
download | external_llvm-74382b7c699120fbec5cb5603c9cf4212eb37f06.zip external_llvm-74382b7c699120fbec5cb5603c9cf4212eb37f06.tar.gz external_llvm-74382b7c699120fbec5cb5603c9cf4212eb37f06.tar.bz2 |
Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.
This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
instead.
4. Weans llvm-db off <iostream>
sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/Miscompilation.cpp')
-rw-r--r-- | tools/bugpoint/Miscompilation.cpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 9c14147..57a4fc7 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -826,8 +826,9 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe) { << ErrMsg << "\n"; exit(1); } - if (BD.writeProgramToFile(TestModuleBC.toString(), Test)) { - errs() << "Error writing bitcode to `" << TestModuleBC << "'\nExiting."; + if (BD.writeProgramToFile(TestModuleBC.str(), Test)) { + errs() << "Error writing bitcode to `" << TestModuleBC.str() + << "'\nExiting."; exit(1); } delete Test; @@ -840,16 +841,17 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe) { exit(1); } - if (BD.writeProgramToFile(SafeModuleBC.toString(), Safe)) { - errs() << "Error writing bitcode to `" << SafeModuleBC << "'\nExiting."; + if (BD.writeProgramToFile(SafeModuleBC.str(), Safe)) { + errs() << "Error writing bitcode to `" << SafeModuleBC.str() + << "'\nExiting."; exit(1); } - std::string SharedObject = BD.compileSharedObject(SafeModuleBC.toString()); + std::string SharedObject = BD.compileSharedObject(SafeModuleBC.str()); delete Safe; // Run the code generator on the `Test' code, loading the shared library. // The function returns whether or not the new output differs from reference. - int Result = BD.diffProgram(TestModuleBC.toString(), SharedObject, false); + int Result = BD.diffProgram(TestModuleBC.str(), SharedObject, false); if (Result) errs() << ": still failing!\n"; @@ -899,8 +901,9 @@ bool BugDriver::debugCodeGenerator() { exit(1); } - if (writeProgramToFile(TestModuleBC.toString(), ToCodeGen)) { - errs() << "Error writing bitcode to `" << TestModuleBC << "'\nExiting."; + if (writeProgramToFile(TestModuleBC.str(), ToCodeGen)) { + errs() << "Error writing bitcode to `" << TestModuleBC.str() + << "'\nExiting."; exit(1); } delete ToCodeGen; @@ -913,31 +916,33 @@ bool BugDriver::debugCodeGenerator() { exit(1); } - if (writeProgramToFile(SafeModuleBC.toString(), ToNotCodeGen)) { - errs() << "Error writing bitcode to `" << SafeModuleBC << "'\nExiting."; + if (writeProgramToFile(SafeModuleBC.str(), ToNotCodeGen)) { + errs() << "Error writing bitcode to `" << SafeModuleBC.str() + << "'\nExiting."; exit(1); } - std::string SharedObject = compileSharedObject(SafeModuleBC.toString()); + std::string SharedObject = compileSharedObject(SafeModuleBC.str()); delete ToNotCodeGen; outs() << "You can reproduce the problem with the command line: \n"; if (isExecutingJIT()) { - outs() << " lli -load " << SharedObject << " " << TestModuleBC; + outs() << " lli -load " << SharedObject << " " << TestModuleBC.str(); } else { - outs() << " llc -f " << TestModuleBC << " -o " << TestModuleBC<< ".s\n"; - outs() << " gcc " << SharedObject << " " << TestModuleBC - << ".s -o " << TestModuleBC << ".exe"; + outs() << " llc -f " << TestModuleBC.str() << " -o " << TestModuleBC.str() + << ".s\n"; + outs() << " gcc " << SharedObject << " " << TestModuleBC.str() + << ".s -o " << TestModuleBC.str() << ".exe"; #if defined (HAVE_LINK_R) outs() << " -Wl,-R."; #endif outs() << "\n"; - outs() << " " << TestModuleBC << ".exe"; + outs() << " " << TestModuleBC.str() << ".exe"; } for (unsigned i=0, e = InputArgv.size(); i != e; ++i) outs() << " " << InputArgv[i]; outs() << '\n'; outs() << "The shared object was created with:\n llc -march=c " - << SafeModuleBC << " -o temporary.c\n" + << SafeModuleBC.str() << " -o temporary.c\n" << " gcc -xc temporary.c -O2 -o " << SharedObject; if (TargetTriple.getArch() == Triple::sparc) outs() << " -G"; // Compile a shared library, `-G' for Sparc |