From e99d2083cf5c8425f01d2e67438155ba98b2ba0e Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Wed, 14 Oct 2015 19:48:01 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250318 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/ExecutionDriver.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 25813b34e62..d7964f357bc 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -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 @@ -124,8 +125,7 @@ namespace { cl::ZeroOrMore, cl::PositionalEatsArgs); cl::opt - 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 GCCToolArgv("gcc-tool-args", cl::Positional, @@ -148,6 +148,13 @@ bool BugDriver::initializeExecutionEnvironment() { SafeInterpreter = nullptr; std::string Message; + if (GCCBinary.empty()) { + if (sys::findProgramByName("clang")) + GCCBinary = "clang"; + else + GCCBinary = "gcc"; + } + switch (InterpreterSel) { case AutoPick: if (!Interpreter) { -- 2.34.1