Make bugpoint work with gcc5 again.

This commit is contained in:
Benjamin Kramer 2020-01-29 03:11:00 +01:00
parent bd31243a34
commit cd87e207ec
3 changed files with 7 additions and 4 deletions

View File

@ -499,7 +499,8 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock *> &BBs) {
std::vector<std::pair<std::string, std::string>> BlockInfo;
for (BasicBlock *BB : Blocks)
BlockInfo.emplace_back(BB->getParent()->getName(), BB->getName());
BlockInfo.emplace_back(std::string(BB->getParent()->getName()),
BB->getName());
SmallVector<BasicBlock *, 16> ToProcess;
for (auto &F : *M) {

View File

@ -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.

View File

@ -48,7 +48,7 @@ getSectionRefsByNameOrIndex(const object::ObjectFile *Obj,
if (!Section.getAsInteger(0, SecIndex))
SecIndices.emplace(SecIndex, false);
else
SecNames.emplace(Section, false);
SecNames.emplace(std::string(Section), false);
}
SecIndex = Obj->isELF() ? 0 : 1;