[llvm] r250318 - [Bugpoint] Use clang by default.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 12:48:01 PDT 2015


Author: davide
Date: Wed Oct 14 14:48:01 2015
New Revision: 250318

URL: http://llvm.org/viewvc/llvm-project?rev=250318&view=rev
Log:
[Bugpoint] Use clang by default.

We now rely on gcc only if either of the following is true:
1) -gcc option is passed by the user
2) clang is not found in the default path.

Differential Revision:	 http://reviews.llvm.org/D13642

Modified:
    llvm/trunk/tools/bugpoint/ExecutionDriver.cpp

Modified: llvm/trunk/tools/bugpoint/ExecutionDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExecutionDriver.cpp?rev=250318&r1=250317&r2=250318&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExecutionDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExecutionDriver.cpp Wed Oct 14 14:48:01 2015
@@ -17,6 +17,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FileUtilities.h"
+#include "llvm/Support/Program.h"
 #include "llvm/Support/SystemUtils.h"
 #include "llvm/Support/raw_ostream.h"
 #include <fstream>
@@ -124,8 +125,7 @@ namespace {
                cl::ZeroOrMore, cl::PositionalEatsArgs);
 
   cl::opt<std::string>
-  GCCBinary("gcc", cl::init("gcc"),
-              cl::desc("The gcc binary to use. (default 'gcc')"));
+  GCCBinary("gcc", cl::init(""), cl::desc("The gcc binary to use."));
 
   cl::list<std::string>
   GCCToolArgv("gcc-tool-args", cl::Positional,
@@ -148,6 +148,13 @@ bool BugDriver::initializeExecutionEnvir
   SafeInterpreter = nullptr;
   std::string Message;
 
+  if (GCCBinary.empty()) {
+    if (sys::findProgramByName("clang"))
+      GCCBinary = "clang";
+    else
+      GCCBinary = "gcc";
+  }
+
   switch (InterpreterSel) {
   case AutoPick:
     if (!Interpreter) {




More information about the llvm-commits mailing list