[llvm] cd87e20 - Make bugpoint work with gcc5 again.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 18:11:19 PST 2020


Author: Benjamin Kramer
Date: 2020-01-29T03:11:00+01:00
New Revision: cd87e207ec7c1d6ea38bf05b8a4e887a1940f37f

URL: https://github.com/llvm/llvm-project/commit/cd87e207ec7c1d6ea38bf05b8a4e887a1940f37f
DIFF: https://github.com/llvm/llvm-project/commit/cd87e207ec7c1d6ea38bf05b8a4e887a1940f37f.diff

LOG: Make bugpoint work with gcc5 again.

Added: 
    

Modified: 
    llvm/tools/bugpoint/CrashDebugger.cpp
    llvm/tools/bugpoint/Miscompilation.cpp
    llvm/tools/llvm-readobj/ObjDumper.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index 73ff1dc11a07..2a94e3d2897b 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -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) {

diff  --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp
index c5c51c869456..02de5d78b594 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.

diff  --git a/llvm/tools/llvm-readobj/ObjDumper.cpp b/llvm/tools/llvm-readobj/ObjDumper.cpp
index 2359699e6ebc..ce61f1c53a4d 100644
--- a/llvm/tools/llvm-readobj/ObjDumper.cpp
+++ b/llvm/tools/llvm-readobj/ObjDumper.cpp
@@ -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;


        


More information about the llvm-commits mailing list