From: Davide Italiano Date: Wed, 14 Oct 2015 19:48:01 +0000 (+0000) Subject: [Bugpoint] Use clang by default. X-Git-Tag: android-x86-7.1-r4~42648 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e99d2083cf5c8425f01d2e67438155ba98b2ba0e;p=android-x86%2Fexternal-llvm.git [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 --- 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) {