diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/tools/bugpoint/Miscompilation.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'llvm/tools/bugpoint/Miscompilation.cpp')
-rw-r--r-- | llvm/tools/bugpoint/Miscompilation.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp index 1621a51c91d6..e69fe9ff6c15 100644 --- a/llvm/tools/bugpoint/Miscompilation.cpp +++ b/llvm/tools/bugpoint/Miscompilation.cpp @@ -389,7 +389,8 @@ ExtractLoops(BugDriver &BD, std::vector<std::pair<std::string, FunctionType *>> MisCompFunctions; for (Function *F : MiscompiledFunctions) { - MisCompFunctions.emplace_back(F->getName(), F->getFunctionType()); + MisCompFunctions.emplace_back(std::string(F->getName()), + F->getFunctionType()); } if (Linker::linkModules(*ToNotOptimize, @@ -415,7 +416,8 @@ ExtractLoops(BugDriver &BD, E = ToOptimizeLoopExtracted->end(); I != E; ++I) if (!I->isDeclaration()) - MisCompFunctions.emplace_back(I->getName(), I->getFunctionType()); + MisCompFunctions.emplace_back(std::string(I->getName()), + I->getFunctionType()); // Okay, great! Now we know that we extracted a loop and that loop // extraction both didn't break the program, and didn't mask the problem. @@ -586,7 +588,8 @@ ExtractBlocks(BugDriver &BD, for (Module::iterator I = Extracted->begin(), E = Extracted->end(); I != E; ++I) if (!I->isDeclaration()) - MisCompFunctions.emplace_back(I->getName(), I->getFunctionType()); + MisCompFunctions.emplace_back(std::string(I->getName()), + I->getFunctionType()); if (Linker::linkModules(*ProgClone, std::move(Extracted))) exit(1); @@ -953,7 +956,8 @@ static Expected<bool> TestCodeGenerator(BugDriver &BD, << "Error making unique filename: " << EC.message() << "\n"; exit(1); } - if (BD.writeProgramToFile(TestModuleBC.str(), TestModuleFD, *Test)) { + if (BD.writeProgramToFile(std::string(TestModuleBC.str()), TestModuleFD, + *Test)) { errs() << "Error writing bitcode to `" << TestModuleBC.str() << "'\nExiting."; exit(1); @@ -972,7 +976,8 @@ static Expected<bool> TestCodeGenerator(BugDriver &BD, exit(1); } - if (BD.writeProgramToFile(SafeModuleBC.str(), SafeModuleFD, *Safe)) { + if (BD.writeProgramToFile(std::string(SafeModuleBC.str()), SafeModuleFD, + *Safe)) { errs() << "Error writing bitcode to `" << SafeModuleBC << "'\nExiting."; exit(1); } @@ -980,7 +985,7 @@ static Expected<bool> TestCodeGenerator(BugDriver &BD, FileRemover SafeModuleBCRemover(SafeModuleBC.str(), !SaveTemps); Expected<std::string> SharedObject = - BD.compileSharedObject(SafeModuleBC.str()); + BD.compileSharedObject(std::string(SafeModuleBC.str())); if (Error E = SharedObject.takeError()) return std::move(E); @@ -988,8 +993,8 @@ static Expected<bool> TestCodeGenerator(BugDriver &BD, // Run the code generator on the `Test' code, loading the shared library. // The function returns whether or not the new output differs from reference. - Expected<bool> Result = - BD.diffProgram(BD.getProgram(), TestModuleBC.str(), *SharedObject, false); + Expected<bool> Result = BD.diffProgram( + BD.getProgram(), std::string(TestModuleBC.str()), *SharedObject, false); if (Error E = Result.takeError()) return std::move(E); @@ -1046,7 +1051,8 @@ Error BugDriver::debugCodeGenerator() { exit(1); } - if (writeProgramToFile(TestModuleBC.str(), TestModuleFD, *ToCodeGen)) { + if (writeProgramToFile(std::string(TestModuleBC.str()), TestModuleFD, + *ToCodeGen)) { errs() << "Error writing bitcode to `" << TestModuleBC << "'\nExiting."; exit(1); } @@ -1062,11 +1068,13 @@ Error BugDriver::debugCodeGenerator() { exit(1); } - if (writeProgramToFile(SafeModuleBC.str(), SafeModuleFD, *ToNotCodeGen)) { + if (writeProgramToFile(std::string(SafeModuleBC.str()), SafeModuleFD, + *ToNotCodeGen)) { errs() << "Error writing bitcode to `" << SafeModuleBC << "'\nExiting."; exit(1); } - Expected<std::string> SharedObject = compileSharedObject(SafeModuleBC.str()); + Expected<std::string> SharedObject = + compileSharedObject(std::string(SafeModuleBC.str())); if (Error E = SharedObject.takeError()) return E; |