[llvm] 42a25e7 - Try harder to fix bugpoint with GCC5

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


Author: Benjamin Kramer
Date: 2020-01-29T03:30:47+01:00
New Revision: 42a25e7fe6ff0eb74c7d91151983fc3fd0d5d10c

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

LOG: Try harder to fix bugpoint with GCC5

Added: 
    

Modified: 
    llvm/tools/bugpoint/CrashDebugger.cpp
    llvm/tools/bugpoint/Miscompilation.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index 2a94e3d2897b..417d24673cca 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -607,7 +607,8 @@ bool ReduceCrashingConditionals::TestBlocks(
   std::vector<std::pair<std::string, std::string>> BlockInfo;
 
   for (const 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) {
@@ -697,7 +698,8 @@ bool ReduceSimplifyCFG::TestBlocks(std::vector<const BasicBlock *> &BBs) {
   std::vector<std::pair<std::string, std::string>> BlockInfo;
 
   for (const BasicBlock *BB : Blocks)
-    BlockInfo.emplace_back(BB->getParent()->getName(), BB->getName());
+    BlockInfo.emplace_back(std::string(BB->getParent()->getName()),
+                           BB->getName());
 
   // Loop over and delete any hack up any blocks that are not listed...
   for (auto &F : *M)

diff  --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp
index 02de5d78b594..e69fe9ff6c15 100644
--- a/llvm/tools/bugpoint/Miscompilation.cpp
+++ b/llvm/tools/bugpoint/Miscompilation.cpp
@@ -588,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);


        


More information about the llvm-commits mailing list