Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 1 | //===- ExecutionDriver.cpp - Allow execution of LLVM program --------------===// |
Misha Brukman | 650ba8e | 2005-04-22 00:00:37 +0000 | [diff] [blame] | 2 | // |
John Criswell | 09344dc | 2003-10-20 17:47:21 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 345353d | 2007-12-29 20:44:31 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | 650ba8e | 2005-04-22 00:00:37 +0000 | [diff] [blame] | 7 | // |
John Criswell | 09344dc | 2003-10-20 17:47:21 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 9 | // |
| 10 | // This file contains code used to execute the program utilizing one of the |
Gabor Greif | 0e535c3c | 2007-07-04 21:55:50 +0000 | [diff] [blame] | 11 | // various ways of running LLVM bitcode. |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 15 | #include "BugDriver.h" |
Chris Lattner | ffac286 | 2006-06-06 22:30:59 +0000 | [diff] [blame] | 16 | #include "ToolRunner.h" |
Reid Spencer | 7c16caa | 2004-09-01 22:55:40 +0000 | [diff] [blame] | 17 | #include "llvm/Support/CommandLine.h" |
| 18 | #include "llvm/Support/Debug.h" |
| 19 | #include "llvm/Support/FileUtilities.h" |
Davide Italiano | 8a5d043 | 2015-10-14 19:48:01 +0000 | [diff] [blame] | 20 | #include "llvm/Support/Program.h" |
Reid Spencer | 7c16caa | 2004-09-01 22:55:40 +0000 | [diff] [blame] | 21 | #include "llvm/Support/SystemUtils.h" |
Chris Lattner | c521f54 | 2009-08-23 22:45:37 +0000 | [diff] [blame] | 22 | #include "llvm/Support/raw_ostream.h" |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 23 | #include <fstream> |
Reid Spencer | c3065b7 | 2006-06-06 00:00:42 +0000 | [diff] [blame] | 24 | |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 25 | using namespace llvm; |
| 26 | |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 27 | namespace { |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 28 | // OutputType - Allow the user to specify the way code should be run, to test |
| 29 | // for miscompilation. |
| 30 | // |
| 31 | enum OutputType { |
| 32 | AutoPick, |
| 33 | RunLLI, |
| 34 | RunJIT, |
| 35 | RunLLC, |
| 36 | RunLLCIA, |
| 37 | LLC_Safe, |
| 38 | CompileCustom, |
| 39 | Custom |
| 40 | }; |
Misha Brukman | 5bc6a8f | 2003-09-29 22:40:52 +0000 | [diff] [blame] | 41 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 42 | cl::opt<double> AbsTolerance("abs-tolerance", |
| 43 | cl::desc("Absolute error tolerated"), |
| 44 | cl::init(0.0)); |
| 45 | cl::opt<double> RelTolerance("rel-tolerance", |
| 46 | cl::desc("Relative error tolerated"), |
| 47 | cl::init(0.0)); |
Chris Lattner | ece10a4 | 2005-01-23 03:45:26 +0000 | [diff] [blame] | 48 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 49 | cl::opt<OutputType> InterpreterSel( |
| 50 | cl::desc("Specify the \"test\" i.e. suspect back-end:"), |
| 51 | cl::values(clEnumValN(AutoPick, "auto", "Use best guess"), |
| 52 | clEnumValN(RunLLI, "run-int", "Execute with the interpreter"), |
| 53 | clEnumValN(RunJIT, "run-jit", "Execute with JIT"), |
| 54 | clEnumValN(RunLLC, "run-llc", "Compile with LLC"), |
| 55 | clEnumValN(RunLLCIA, "run-llc-ia", |
| 56 | "Compile with LLC with integrated assembler"), |
| 57 | clEnumValN(LLC_Safe, "llc-safe", "Use LLC for all"), |
| 58 | clEnumValN(CompileCustom, "compile-custom", |
| 59 | "Use -compile-command to define a command to " |
| 60 | "compile the bitcode. Useful to avoid linking."), |
| 61 | clEnumValN(Custom, "run-custom", |
| 62 | "Use -exec-command to define a command to execute " |
| 63 | "the bitcode. Useful for cross-compilation."), |
| 64 | clEnumValEnd), |
| 65 | cl::init(AutoPick)); |
Chris Lattner | 68efaa7 | 2003-04-23 20:31:37 +0000 | [diff] [blame] | 66 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 67 | cl::opt<OutputType> SafeInterpreterSel( |
| 68 | cl::desc("Specify \"safe\" i.e. known-good backend:"), |
| 69 | cl::values(clEnumValN(AutoPick, "safe-auto", "Use best guess"), |
| 70 | clEnumValN(RunLLC, "safe-run-llc", "Compile with LLC"), |
| 71 | clEnumValN(Custom, "safe-run-custom", |
| 72 | "Use -exec-command to define a command to execute " |
| 73 | "the bitcode. Useful for cross-compilation."), |
| 74 | clEnumValEnd), |
| 75 | cl::init(AutoPick)); |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 76 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 77 | cl::opt<std::string> SafeInterpreterPath( |
| 78 | "safe-path", cl::desc("Specify the path to the \"safe\" backend program"), |
| 79 | cl::init("")); |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 80 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 81 | cl::opt<bool> AppendProgramExitCode( |
| 82 | "append-exit-code", |
| 83 | cl::desc("Append the exit code to the output so it gets diff'd too"), |
| 84 | cl::init(false)); |
Reid Spencer | d077fe7 | 2006-11-28 07:04:10 +0000 | [diff] [blame] | 85 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 86 | cl::opt<std::string> |
| 87 | InputFile("input", cl::init("/dev/null"), |
| 88 | cl::desc("Filename to pipe in as stdin (default: /dev/null)")); |
Chris Lattner | dc92fa6 | 2003-10-14 22:24:31 +0000 | [diff] [blame] | 89 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 90 | cl::list<std::string> |
| 91 | AdditionalSOs("additional-so", cl::desc("Additional shared objects to load " |
| 92 | "into executing programs")); |
Chris Lattner | 4e0969b | 2004-07-24 07:53:26 +0000 | [diff] [blame] | 93 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 94 | cl::list<std::string> AdditionalLinkerArgs( |
| 95 | "Xlinker", cl::desc("Additional arguments to pass to the linker")); |
Anton Korobeynikov | c53565c | 2008-04-28 20:53:48 +0000 | [diff] [blame] | 96 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 97 | cl::opt<std::string> CustomCompileCommand( |
| 98 | "compile-command", cl::init("llc"), |
| 99 | cl::desc("Command to compile the bitcode (use with -compile-custom) " |
| 100 | "(default: llc)")); |
Andrew Trick | 8665d59 | 2011-02-08 18:20:48 +0000 | [diff] [blame] | 101 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 102 | cl::opt<std::string> CustomExecCommand( |
| 103 | "exec-command", cl::init("simulate"), |
| 104 | cl::desc("Command to execute the bitcode (use with -run-custom) " |
| 105 | "(default: simulate)")); |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 106 | } |
| 107 | |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 108 | namespace llvm { |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 109 | // Anything specified after the --args option are taken as arguments to the |
| 110 | // program being debugged. |
| 111 | cl::list<std::string> InputArgv("args", cl::Positional, |
| 112 | cl::desc("<program arguments>..."), |
| 113 | cl::ZeroOrMore, cl::PositionalEatsArgs); |
Daniel Dunbar | a53337f | 2009-09-07 19:26:11 +0000 | [diff] [blame] | 114 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 115 | cl::opt<std::string> |
| 116 | OutputPrefix("output-prefix", cl::init("bugpoint"), |
| 117 | cl::desc("Prefix to use for outputs (default: 'bugpoint')")); |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 118 | } |
Brian Gaeke | 4a278f0 | 2004-05-04 21:09:16 +0000 | [diff] [blame] | 119 | |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 120 | namespace { |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 121 | cl::list<std::string> ToolArgv("tool-args", cl::Positional, |
| 122 | cl::desc("<tool arguments>..."), cl::ZeroOrMore, |
| 123 | cl::PositionalEatsArgs); |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 124 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 125 | cl::list<std::string> SafeToolArgv("safe-tool-args", cl::Positional, |
| 126 | cl::desc("<safe-tool arguments>..."), |
| 127 | cl::ZeroOrMore, cl::PositionalEatsArgs); |
Bill Wendling | bf5d827 | 2009-03-02 23:13:18 +0000 | [diff] [blame] | 128 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 129 | cl::opt<std::string> CCBinary("gcc", cl::init(""), |
| 130 | cl::desc("The gcc binary to use.")); |
Kalle Raiskila | 6be5829 | 2010-05-10 07:38:37 +0000 | [diff] [blame] | 131 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 132 | cl::list<std::string> CCToolArgv("gcc-tool-args", cl::Positional, |
| 133 | cl::desc("<gcc-tool arguments>..."), |
| 134 | cl::ZeroOrMore, cl::PositionalEatsArgs); |
Chris Lattner | 2f1aa11 | 2004-01-14 03:38:37 +0000 | [diff] [blame] | 135 | } |
Misha Brukman | 40feb36 | 2003-07-30 20:15:44 +0000 | [diff] [blame] | 136 | |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 137 | //===----------------------------------------------------------------------===// |
| 138 | // BugDriver method implementation |
| 139 | // |
| 140 | |
| 141 | /// initializeExecutionEnvironment - This method is used to set up the |
| 142 | /// environment for executing LLVM programs. |
| 143 | /// |
| 144 | bool BugDriver::initializeExecutionEnvironment() { |
Dan Gohman | ee05152 | 2009-07-16 15:30:09 +0000 | [diff] [blame] | 145 | outs() << "Initializing execution environment: "; |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 146 | |
Misha Brukman | 5bc6a8f | 2003-09-29 22:40:52 +0000 | [diff] [blame] | 147 | // Create an instance of the AbstractInterpreter interface as specified on |
| 148 | // the command line |
Craig Topper | e6cb63e | 2014-04-25 04:24:47 +0000 | [diff] [blame] | 149 | SafeInterpreter = nullptr; |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 150 | std::string Message; |
Brian Gaeke | 4a278f0 | 2004-05-04 21:09:16 +0000 | [diff] [blame] | 151 | |
Davide Italiano | ab25621 | 2015-10-14 20:29:54 +0000 | [diff] [blame] | 152 | if (CCBinary.empty()) { |
Davide Italiano | 8a5d043 | 2015-10-14 19:48:01 +0000 | [diff] [blame] | 153 | if (sys::findProgramByName("clang")) |
Davide Italiano | ab25621 | 2015-10-14 20:29:54 +0000 | [diff] [blame] | 154 | CCBinary = "clang"; |
Davide Italiano | 8a5d043 | 2015-10-14 19:48:01 +0000 | [diff] [blame] | 155 | else |
Davide Italiano | ab25621 | 2015-10-14 20:29:54 +0000 | [diff] [blame] | 156 | CCBinary = "gcc"; |
Davide Italiano | 8a5d043 | 2015-10-14 19:48:01 +0000 | [diff] [blame] | 157 | } |
| 158 | |
Chris Lattner | 7709ec5 | 2003-05-03 03:19:41 +0000 | [diff] [blame] | 159 | switch (InterpreterSel) { |
Brian Gaeke | 9a0bdb1 | 2003-10-21 17:41:35 +0000 | [diff] [blame] | 160 | case AutoPick: |
Brian Gaeke | 9a0bdb1 | 2003-10-21 17:41:35 +0000 | [diff] [blame] | 161 | if (!Interpreter) { |
| 162 | InterpreterSel = RunJIT; |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 163 | Interpreter = |
| 164 | AbstractInterpreter::createJIT(getToolName(), Message, &ToolArgv); |
Brian Gaeke | 9a0bdb1 | 2003-10-21 17:41:35 +0000 | [diff] [blame] | 165 | } |
| 166 | if (!Interpreter) { |
| 167 | InterpreterSel = RunLLC; |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 168 | Interpreter = AbstractInterpreter::createLLC( |
| 169 | getToolName(), Message, CCBinary, &ToolArgv, &CCToolArgv); |
Brian Gaeke | 9a0bdb1 | 2003-10-21 17:41:35 +0000 | [diff] [blame] | 170 | } |
| 171 | if (!Interpreter) { |
| 172 | InterpreterSel = RunLLI; |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 173 | Interpreter = |
| 174 | AbstractInterpreter::createLLI(getToolName(), Message, &ToolArgv); |
Brian Gaeke | 9a0bdb1 | 2003-10-21 17:41:35 +0000 | [diff] [blame] | 175 | } |
| 176 | if (!Interpreter) { |
| 177 | InterpreterSel = AutoPick; |
| 178 | Message = "Sorry, I can't automatically select an interpreter!\n"; |
| 179 | } |
| 180 | break; |
Chris Lattner | 3f6e522 | 2003-10-14 21:59:36 +0000 | [diff] [blame] | 181 | case RunLLI: |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 182 | Interpreter = |
| 183 | AbstractInterpreter::createLLI(getToolName(), Message, &ToolArgv); |
Chris Lattner | 3f6e522 | 2003-10-14 21:59:36 +0000 | [diff] [blame] | 184 | break; |
| 185 | case RunLLC: |
Chris Lattner | fd38132 | 2010-03-16 06:41:47 +0000 | [diff] [blame] | 186 | case RunLLCIA: |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 187 | case LLC_Safe: |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 188 | Interpreter = AbstractInterpreter::createLLC( |
| 189 | getToolName(), Message, CCBinary, &ToolArgv, &CCToolArgv, |
| 190 | InterpreterSel == RunLLCIA); |
Chris Lattner | 3f6e522 | 2003-10-14 21:59:36 +0000 | [diff] [blame] | 191 | break; |
| 192 | case RunJIT: |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 193 | Interpreter = |
| 194 | AbstractInterpreter::createJIT(getToolName(), Message, &ToolArgv); |
Chris Lattner | 3f6e522 | 2003-10-14 21:59:36 +0000 | [diff] [blame] | 195 | break; |
Andrew Trick | 8665d59 | 2011-02-08 18:20:48 +0000 | [diff] [blame] | 196 | case CompileCustom: |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 197 | Interpreter = AbstractInterpreter::createCustomCompiler( |
| 198 | Message, CustomCompileCommand); |
Andrew Trick | 8665d59 | 2011-02-08 18:20:48 +0000 | [diff] [blame] | 199 | break; |
Anton Korobeynikov | c53565c | 2008-04-28 20:53:48 +0000 | [diff] [blame] | 200 | case Custom: |
Andrew Trick | 8665d59 | 2011-02-08 18:20:48 +0000 | [diff] [blame] | 201 | Interpreter = |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 202 | AbstractInterpreter::createCustomExecutor(Message, CustomExecCommand); |
Anton Korobeynikov | c53565c | 2008-04-28 20:53:48 +0000 | [diff] [blame] | 203 | break; |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 204 | } |
Matthijs Kooijman | 3bb1276 | 2008-06-12 13:09:43 +0000 | [diff] [blame] | 205 | if (!Interpreter) |
Dan Gohman | d8db376 | 2009-07-15 16:35:29 +0000 | [diff] [blame] | 206 | errs() << Message; |
Matthijs Kooijman | 3bb1276 | 2008-06-12 13:09:43 +0000 | [diff] [blame] | 207 | else // Display informational messages on stdout instead of stderr |
Dan Gohman | ee05152 | 2009-07-16 15:30:09 +0000 | [diff] [blame] | 208 | outs() << Message; |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 209 | |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 210 | std::string Path = SafeInterpreterPath; |
| 211 | if (Path.empty()) |
| 212 | Path = getToolName(); |
| 213 | std::vector<std::string> SafeToolArgs = SafeToolArgv; |
| 214 | switch (SafeInterpreterSel) { |
| 215 | case AutoPick: |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 216 | // In "llc-safe" mode, default to using LLC as the "safe" backend. |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 217 | if (!SafeInterpreter && InterpreterSel == LLC_Safe) { |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 218 | SafeInterpreterSel = RunLLC; |
| 219 | SafeToolArgs.push_back("--relocation-model=pic"); |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 220 | SafeInterpreter = AbstractInterpreter::createLLC( |
| 221 | Path.c_str(), Message, CCBinary, &SafeToolArgs, &CCToolArgv); |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 222 | } |
| 223 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 224 | if (!SafeInterpreter && InterpreterSel != RunLLC && |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 225 | InterpreterSel != RunJIT) { |
| 226 | SafeInterpreterSel = RunLLC; |
| 227 | SafeToolArgs.push_back("--relocation-model=pic"); |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 228 | SafeInterpreter = AbstractInterpreter::createLLC( |
| 229 | Path.c_str(), Message, CCBinary, &SafeToolArgs, &CCToolArgv); |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 230 | } |
| 231 | if (!SafeInterpreter) { |
| 232 | SafeInterpreterSel = AutoPick; |
Saleem Abdulrasool | 5f8609b | 2013-01-24 16:49:14 +0000 | [diff] [blame] | 233 | Message = "Sorry, I can't automatically select a safe interpreter!\n"; |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 234 | } |
| 235 | break; |
| 236 | case RunLLC: |
Chris Lattner | fd38132 | 2010-03-16 06:41:47 +0000 | [diff] [blame] | 237 | case RunLLCIA: |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 238 | SafeToolArgs.push_back("--relocation-model=pic"); |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 239 | SafeInterpreter = AbstractInterpreter::createLLC( |
| 240 | Path.c_str(), Message, CCBinary, &SafeToolArgs, &CCToolArgv, |
| 241 | SafeInterpreterSel == RunLLCIA); |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 242 | break; |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 243 | case Custom: |
Andrew Trick | 8665d59 | 2011-02-08 18:20:48 +0000 | [diff] [blame] | 244 | SafeInterpreter = |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 245 | AbstractInterpreter::createCustomExecutor(Message, CustomExecCommand); |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 246 | break; |
| 247 | default: |
| 248 | Message = "Sorry, this back-end is not supported by bugpoint as the " |
| 249 | "\"safe\" backend right now!\n"; |
| 250 | break; |
Chris Lattner | 898de4a | 2004-02-18 20:52:02 +0000 | [diff] [blame] | 251 | } |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 252 | if (!SafeInterpreter) { |
| 253 | outs() << Message << "\nExiting.\n"; |
| 254 | exit(1); |
| 255 | } |
Andrew Trick | 69a963e | 2011-02-08 18:07:10 +0000 | [diff] [blame] | 256 | |
Davide Italiano | ab25621 | 2015-10-14 20:29:54 +0000 | [diff] [blame] | 257 | cc = CC::create(Message, CCBinary, &CCToolArgv); |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 258 | if (!cc) { |
| 259 | outs() << Message << "\nExiting.\n"; |
| 260 | exit(1); |
| 261 | } |
Misha Brukman | 0fd3172 | 2003-07-24 21:59:10 +0000 | [diff] [blame] | 262 | |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 263 | // If there was an error creating the selected interpreter, quit with error. |
Craig Topper | e6cb63e | 2014-04-25 04:24:47 +0000 | [diff] [blame] | 264 | return Interpreter == nullptr; |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 265 | } |
| 266 | |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 267 | /// compileProgram - Try to compile the specified module, returning false and |
| 268 | /// setting Error if an error occurs. This is used for code generation |
| 269 | /// crash testing. |
Chris Lattner | 96d41dd | 2004-02-18 23:25:22 +0000 | [diff] [blame] | 270 | /// |
Rafael Espindola | d1c7ef4 | 2010-08-05 03:00:22 +0000 | [diff] [blame] | 271 | void BugDriver::compileProgram(Module *M, std::string *Error) const { |
Gabor Greif | 0e535c3c | 2007-07-04 21:55:50 +0000 | [diff] [blame] | 272 | // Emit the program to a bitcode file... |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 273 | SmallString<128> BitcodeFile; |
| 274 | int BitcodeFD; |
Rafael Espindola | 4453e4294 | 2014-06-13 03:07:50 +0000 | [diff] [blame] | 275 | std::error_code EC = sys::fs::createUniqueFile( |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 276 | OutputPrefix + "-test-program-%%%%%%%.bc", BitcodeFD, BitcodeFile); |
| 277 | if (EC) { |
| 278 | errs() << ToolName << ": Error making unique filename: " << EC.message() |
Dan Gohman | d8db376 | 2009-07-15 16:35:29 +0000 | [diff] [blame] | 279 | << "\n"; |
Reid Spencer | e4ca722 | 2006-08-23 20:34:57 +0000 | [diff] [blame] | 280 | exit(1); |
| 281 | } |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 282 | if (writeProgramToFile(BitcodeFile.str(), BitcodeFD, M)) { |
| 283 | errs() << ToolName << ": Error emitting bitcode to file '" << BitcodeFile |
| 284 | << "'!\n"; |
Chris Lattner | 96d41dd | 2004-02-18 23:25:22 +0000 | [diff] [blame] | 285 | exit(1); |
| 286 | } |
| 287 | |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 288 | // Remove the temporary bitcode file when we are done. |
Michael J. Spencer | c60223e | 2011-03-31 13:04:19 +0000 | [diff] [blame] | 289 | FileRemover BitcodeFileRemover(BitcodeFile.str(), !SaveTemps); |
Chris Lattner | 96d41dd | 2004-02-18 23:25:22 +0000 | [diff] [blame] | 290 | |
| 291 | // Actually compile the program! |
Duncan Sands | e9cd6d0 | 2010-05-24 07:49:55 +0000 | [diff] [blame] | 292 | Interpreter->compileProgram(BitcodeFile.str(), Error, Timeout, MemoryLimit); |
Chris Lattner | 96d41dd | 2004-02-18 23:25:22 +0000 | [diff] [blame] | 293 | } |
| 294 | |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 295 | /// executeProgram - This method runs "Program", capturing the output of the |
| 296 | /// program to a file, returning the filename of the file. A recommended |
| 297 | /// filename may be optionally specified. |
| 298 | /// |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 299 | std::string |
| 300 | BugDriver::executeProgram(const Module *Program, std::string OutputFile, |
| 301 | std::string BitcodeFile, const std::string &SharedObj, |
| 302 | AbstractInterpreter *AI, std::string *Error) const { |
| 303 | if (!AI) |
| 304 | AI = Interpreter; |
Chris Lattner | 3f6e522 | 2003-10-14 21:59:36 +0000 | [diff] [blame] | 305 | assert(AI && "Interpreter should have been created already!"); |
Gabor Greif | 0e535c3c | 2007-07-04 21:55:50 +0000 | [diff] [blame] | 306 | bool CreatedBitcode = false; |
Gabor Greif | 0e535c3c | 2007-07-04 21:55:50 +0000 | [diff] [blame] | 307 | if (BitcodeFile.empty()) { |
| 308 | // Emit the program to a bitcode file... |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 309 | SmallString<128> UniqueFilename; |
| 310 | int UniqueFD; |
Rafael Espindola | 4453e4294 | 2014-06-13 03:07:50 +0000 | [diff] [blame] | 311 | std::error_code EC = sys::fs::createUniqueFile( |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 312 | OutputPrefix + "-test-program-%%%%%%%.bc", UniqueFD, UniqueFilename); |
| 313 | if (EC) { |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 314 | errs() << ToolName << ": Error making unique filename: " << EC.message() |
| 315 | << "!\n"; |
Reid Spencer | e4ca722 | 2006-08-23 20:34:57 +0000 | [diff] [blame] | 316 | exit(1); |
| 317 | } |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 318 | BitcodeFile = UniqueFilename.str(); |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 319 | |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 320 | if (writeProgramToFile(BitcodeFile, UniqueFD, Program)) { |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 321 | errs() << ToolName << ": Error emitting bitcode to file '" << BitcodeFile |
| 322 | << "'!\n"; |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 323 | exit(1); |
| 324 | } |
Gabor Greif | 0e535c3c | 2007-07-04 21:55:50 +0000 | [diff] [blame] | 325 | CreatedBitcode = true; |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 326 | } |
| 327 | |
Gabor Greif | 0e535c3c | 2007-07-04 21:55:50 +0000 | [diff] [blame] | 328 | // Remove the temporary bitcode file when we are done. |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 329 | std::string BitcodePath(BitcodeFile); |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 330 | FileRemover BitcodeFileRemover(BitcodePath, CreatedBitcode && !SaveTemps); |
Chris Lattner | 1f80a92 | 2004-02-18 22:01:21 +0000 | [diff] [blame] | 331 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 332 | if (OutputFile.empty()) |
| 333 | OutputFile = OutputPrefix + "-execution-output-%%%%%%%"; |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 334 | |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 335 | // Check to see if this is a valid output filename... |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 336 | SmallString<128> UniqueFile; |
Rafael Espindola | 4453e4294 | 2014-06-13 03:07:50 +0000 | [diff] [blame] | 337 | std::error_code EC = sys::fs::createUniqueFile(OutputFile, UniqueFile); |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 338 | if (EC) { |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 339 | errs() << ToolName << ": Error making unique filename: " << EC.message() |
| 340 | << "\n"; |
Reid Spencer | e4ca722 | 2006-08-23 20:34:57 +0000 | [diff] [blame] | 341 | exit(1); |
| 342 | } |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 343 | OutputFile = UniqueFile.str(); |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 344 | |
Chris Lattner | 3f6e522 | 2003-10-14 21:59:36 +0000 | [diff] [blame] | 345 | // Figure out which shared objects to run, if any. |
Chris Lattner | dc92fa6 | 2003-10-14 22:24:31 +0000 | [diff] [blame] | 346 | std::vector<std::string> SharedObjs(AdditionalSOs); |
Chris Lattner | 3f6e522 | 2003-10-14 21:59:36 +0000 | [diff] [blame] | 347 | if (!SharedObj.empty()) |
| 348 | SharedObjs.push_back(SharedObj); |
| 349 | |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 350 | int RetVal = AI->ExecuteProgram(BitcodeFile, InputArgv, InputFile, OutputFile, |
| 351 | Error, AdditionalLinkerArgs, SharedObjs, |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 352 | Timeout, MemoryLimit); |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 353 | if (!Error->empty()) |
| 354 | return OutputFile; |
Chris Lattner | 4e0969b | 2004-07-24 07:53:26 +0000 | [diff] [blame] | 355 | |
| 356 | if (RetVal == -1) { |
Dan Gohman | d8db376 | 2009-07-15 16:35:29 +0000 | [diff] [blame] | 357 | errs() << "<timeout>"; |
Chris Lattner | 4e0969b | 2004-07-24 07:53:26 +0000 | [diff] [blame] | 358 | static bool FirstTimeout = true; |
| 359 | if (FirstTimeout) { |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 360 | outs() |
| 361 | << "\n" |
| 362 | "*** Program execution timed out! This mechanism is designed to " |
| 363 | "handle\n" |
| 364 | " programs stuck in infinite loops gracefully. The -timeout " |
| 365 | "option\n" |
| 366 | " can be used to change the timeout threshold or disable it " |
| 367 | "completely\n" |
| 368 | " (with -timeout=0). This message is only displayed once.\n"; |
Chris Lattner | 4e0969b | 2004-07-24 07:53:26 +0000 | [diff] [blame] | 369 | FirstTimeout = false; |
| 370 | } |
| 371 | } |
Chris Lattner | 3f6e522 | 2003-10-14 21:59:36 +0000 | [diff] [blame] | 372 | |
Reid Spencer | d077fe7 | 2006-11-28 07:04:10 +0000 | [diff] [blame] | 373 | if (AppendProgramExitCode) { |
| 374 | std::ofstream outFile(OutputFile.c_str(), std::ios_base::app); |
| 375 | outFile << "exit " << RetVal << '\n'; |
| 376 | outFile.close(); |
| 377 | } |
| 378 | |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 379 | // Return the filename we captured the output to. |
| 380 | return OutputFile; |
| 381 | } |
| 382 | |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 383 | /// executeProgramSafely - Used to create reference output with the "safe" |
Brian Gaeke | 35145be | 2004-02-11 18:37:32 +0000 | [diff] [blame] | 384 | /// backend, if reference output is not provided. |
| 385 | /// |
Rafael Espindola | c89b1ef | 2010-07-30 14:19:00 +0000 | [diff] [blame] | 386 | std::string BugDriver::executeProgramSafely(const Module *Program, |
Benjamin Kramer | c321e53 | 2016-06-08 19:09:22 +0000 | [diff] [blame] | 387 | const std::string &OutputFile, |
Rafael Espindola | e490460 | 2010-07-31 14:34:49 +0000 | [diff] [blame] | 388 | std::string *Error) const { |
Rafael Espindola | c89b1ef | 2010-07-30 14:19:00 +0000 | [diff] [blame] | 389 | return executeProgram(Program, OutputFile, "", "", SafeInterpreter, Error); |
Brian Gaeke | 35145be | 2004-02-11 18:37:32 +0000 | [diff] [blame] | 390 | } |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 391 | |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 392 | std::string BugDriver::compileSharedObject(const std::string &BitcodeFile, |
| 393 | std::string &Error) { |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 394 | assert(Interpreter && "Interpreter should have been created already!"); |
Rafael Espindola | 34889ca | 2013-06-17 19:21:38 +0000 | [diff] [blame] | 395 | std::string OutputFile; |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 396 | |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 397 | // Using the known-good backend. |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 398 | CC::FileType FT = SafeInterpreter->OutputCode(BitcodeFile, OutputFile, Error); |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 399 | if (!Error.empty()) |
| 400 | return ""; |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 401 | |
Chris Lattner | f8a84db | 2003-10-14 21:09:11 +0000 | [diff] [blame] | 402 | std::string SharedObjectFile; |
Davide Italiano | ab25621 | 2015-10-14 20:29:54 +0000 | [diff] [blame] | 403 | bool Failure = cc->MakeSharedObject(OutputFile, FT, SharedObjectFile, |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 404 | AdditionalLinkerArgs, Error); |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 405 | if (!Error.empty()) |
| 406 | return ""; |
| 407 | if (Failure) |
Chris Lattner | f8a84db | 2003-10-14 21:09:11 +0000 | [diff] [blame] | 408 | exit(1); |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 409 | |
| 410 | // Remove the intermediate C file |
Rafael Espindola | 34889ca | 2013-06-17 19:21:38 +0000 | [diff] [blame] | 411 | sys::fs::remove(OutputFile); |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 412 | |
Rafael Espindola | c32573b | 2014-03-14 15:13:35 +0000 | [diff] [blame] | 413 | return SharedObjectFile; |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 414 | } |
| 415 | |
Patrick Jenkins | c46c038 | 2006-08-15 16:40:49 +0000 | [diff] [blame] | 416 | /// createReferenceFile - calls compileProgram and then records the output |
Andrew Trick | 69a963e | 2011-02-08 18:07:10 +0000 | [diff] [blame] | 417 | /// into ReferenceOutputFile. Returns true if reference file created, false |
Patrick Jenkins | c46c038 | 2006-08-15 16:40:49 +0000 | [diff] [blame] | 418 | /// otherwise. Note: initializeExecutionEnvironment should be called BEFORE |
| 419 | /// this function. |
| 420 | /// |
Chris Lattner | 634bc04 | 2006-09-15 21:29:15 +0000 | [diff] [blame] | 421 | bool BugDriver::createReferenceFile(Module *M, const std::string &Filename) { |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 422 | std::string Error; |
| 423 | compileProgram(Program, &Error); |
| 424 | if (!Error.empty()) |
Patrick Jenkins | c46c038 | 2006-08-15 16:40:49 +0000 | [diff] [blame] | 425 | return false; |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 426 | |
Rafael Espindola | c89b1ef | 2010-07-30 14:19:00 +0000 | [diff] [blame] | 427 | ReferenceOutputFile = executeProgramSafely(Program, Filename, &Error); |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 428 | if (!Error.empty()) { |
| 429 | errs() << Error; |
Dan Gohman | 414cf50 | 2008-12-08 04:02:47 +0000 | [diff] [blame] | 430 | if (Interpreter != SafeInterpreter) { |
Dan Gohman | d8db376 | 2009-07-15 16:35:29 +0000 | [diff] [blame] | 431 | errs() << "*** There is a bug running the \"safe\" backend. Either" |
Eric Christopher | 64a2323 | 2012-03-23 05:50:46 +0000 | [diff] [blame] | 432 | << " debug it (for example with the -run-jit bugpoint option," |
| 433 | << " if JIT is being used as the \"safe\" backend), or fix the" |
Dan Gohman | d8db376 | 2009-07-15 16:35:29 +0000 | [diff] [blame] | 434 | << " error some other way.\n"; |
Patrick Jenkins | c46c038 | 2006-08-15 16:40:49 +0000 | [diff] [blame] | 435 | } |
| 436 | return false; |
| 437 | } |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 438 | outs() << "\nReference output is: " << ReferenceOutputFile << "\n\n"; |
Patrick Jenkins | c46c038 | 2006-08-15 16:40:49 +0000 | [diff] [blame] | 439 | return true; |
| 440 | } |
Misha Brukman | d792c9b | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 441 | |
Patrick Jenkins | c46c038 | 2006-08-15 16:40:49 +0000 | [diff] [blame] | 442 | /// diffProgram - This method executes the specified module and diffs the |
| 443 | /// output against the file specified by ReferenceOutputFile. If the output |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 444 | /// is different, 1 is returned. If there is a problem with the code |
Andrew Trick | 55aeb55 | 2011-05-11 16:31:24 +0000 | [diff] [blame] | 445 | /// generator (e.g., llc crashes), this will set ErrMsg. |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 446 | /// |
Rafael Espindola | c89b1ef | 2010-07-30 14:19:00 +0000 | [diff] [blame] | 447 | bool BugDriver::diffProgram(const Module *Program, |
| 448 | const std::string &BitcodeFile, |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 449 | const std::string &SharedObject, bool RemoveBitcode, |
Rafael Espindola | e490460 | 2010-07-31 14:34:49 +0000 | [diff] [blame] | 450 | std::string *ErrMsg) const { |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 451 | // Execute the program, generating an output file... |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 452 | std::string Output( |
Craig Topper | e6cb63e | 2014-04-25 04:24:47 +0000 | [diff] [blame] | 453 | executeProgram(Program, "", BitcodeFile, SharedObject, nullptr, ErrMsg)); |
Nick Lewycky | 6ba630b | 2010-04-12 05:08:25 +0000 | [diff] [blame] | 454 | if (!ErrMsg->empty()) |
| 455 | return false; |
Brian Gaeke | 35145be | 2004-02-11 18:37:32 +0000 | [diff] [blame] | 456 | |
Chris Lattner | aa997fb | 2003-08-01 20:29:45 +0000 | [diff] [blame] | 457 | std::string Error; |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 458 | bool FilesDifferent = false; |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 459 | if (int Diff = DiffFilesWithTolerance(ReferenceOutputFile, Output, |
Chris Lattner | ece10a4 | 2005-01-23 03:45:26 +0000 | [diff] [blame] | 460 | AbsTolerance, RelTolerance, &Error)) { |
| 461 | if (Diff == 2) { |
Dan Gohman | d8db376 | 2009-07-15 16:35:29 +0000 | [diff] [blame] | 462 | errs() << "While diffing output: " << Error << '\n'; |
Chris Lattner | aa997fb | 2003-08-01 20:29:45 +0000 | [diff] [blame] | 463 | exit(1); |
| 464 | } |
| 465 | FilesDifferent = true; |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 466 | } else { |
David Goodwin | 73f4e3f | 2009-07-10 21:39:28 +0000 | [diff] [blame] | 467 | // Remove the generated output if there are no differences. |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 468 | sys::fs::remove(Output); |
David Goodwin | 73f4e3f | 2009-07-10 21:39:28 +0000 | [diff] [blame] | 469 | } |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 470 | |
Gabor Greif | 0e535c3c | 2007-07-04 21:55:50 +0000 | [diff] [blame] | 471 | // Remove the bitcode file if we are supposed to. |
| 472 | if (RemoveBitcode) |
Rafael Espindola | becba2b | 2013-06-18 16:14:09 +0000 | [diff] [blame] | 473 | sys::fs::remove(BitcodeFile); |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 474 | return FilesDifferent; |
| 475 | } |
Misha Brukman | 539f959 | 2003-07-28 19:16:14 +0000 | [diff] [blame] | 476 | |
Justin Bogner | 8d0a081 | 2016-09-02 01:21:37 +0000 | [diff] [blame^] | 477 | bool BugDriver::isExecutingJIT() { return InterpreterSel == RunJIT; } |