[llvm] r306208 - Ensure backends available in 'opt' are also available in 'bugpoint'

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 24 01:09:34 PDT 2017


Author: grosser
Date: Sat Jun 24 03:09:33 2017
New Revision: 306208

URL: http://llvm.org/viewvc/llvm-project?rev=306208&view=rev
Log:
Ensure backends available in 'opt' are also available in 'bugpoint'

This patch links LLVM back-ends into bugpoint the same way they are already
available in 'opt' and 'clang'. This resolves an inconsistency that allowed the
use of LLVM backends in loadable modules that run in 'opt', but that would
prevent the debugging of these modules with bugpoint due to unavailable /
unresolved symbols.

For e.g. In D31859, Polly requires the NVPTX back-end.

Reviewers: hfinkel, bogner, chandlerc, grosser, Meinersbur

Subscribers: bollu, mgorny, grosser, Meinersbur

Tags: #polly

Contributed by: Singapuram Sanjay

Differential Revision: https://reviews.llvm.org/D32003

Modified:
    llvm/trunk/tools/bugpoint/CMakeLists.txt
    llvm/trunk/tools/bugpoint/LLVMBuild.txt
    llvm/trunk/tools/bugpoint/bugpoint.cpp

Modified: llvm/trunk/tools/bugpoint/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CMakeLists.txt?rev=306208&r1=306207&r2=306208&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/CMakeLists.txt (original)
+++ llvm/trunk/tools/bugpoint/CMakeLists.txt Sat Jun 24 03:09:33 2017
@@ -1,4 +1,5 @@
 set(LLVM_LINK_COMPONENTS
+  ${LLVM_TARGETS_TO_BUILD}
   Analysis
   BitWriter
   CodeGen

Modified: llvm/trunk/tools/bugpoint/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/LLVMBuild.txt?rev=306208&r1=306207&r2=306208&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/LLVMBuild.txt (original)
+++ llvm/trunk/tools/bugpoint/LLVMBuild.txt Sat Jun 24 03:09:33 2017
@@ -30,3 +30,4 @@ required_libraries =
  Linker
  ObjCARC
  Scalar
+ all-targets

Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=306208&r1=306207&r2=306208&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/bugpoint.cpp (original)
+++ llvm/trunk/tools/bugpoint/bugpoint.cpp Sat Jun 24 03:09:33 2017
@@ -26,6 +26,7 @@
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Signals.h"
+#include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/Valgrind.h"
 #include "llvm/Transforms/IPO/AlwaysInliner.h"
 #include "llvm/Transforms/IPO/PassManagerBuilder.h"
@@ -138,6 +139,14 @@ int main(int argc, char **argv) {
   polly::initializePollyPasses(Registry);
 #endif
 
+  if (std::getenv("bar") == (char*) -1) {
+    InitializeAllTargets();
+    InitializeAllTargetMCs();
+    InitializeAllAsmPrinters();
+    InitializeAllAsmParsers();
+    InitializeAllDisassemblers();
+  }
+
   cl::ParseCommandLineOptions(argc, argv,
                               "LLVM automatic testcase reducer. See\nhttp://"
                               "llvm.org/cmds/bugpoint.html"




More information about the llvm-commits mailing list