Lines Matching +full:no +full:- +full:temp +full:- +full:support
1 //===- ExecutionDriver.cpp - Allow execution of LLVM program --------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
16 #include "llvm/Support/CommandLine.h"
17 #include "llvm/Support/Debug.h"
18 #include "llvm/Support/FileUtilities.h"
19 #include "llvm/Support/Program.h"
20 #include "llvm/Support/SystemUtils.h"
21 #include "llvm/Support/raw_ostream.h"
27 // OutputType - Allow the user to specify the way code should be run, to test
40 cl::opt<double> AbsTolerance("abs-tolerance",
43 cl::opt<double> RelTolerance("rel-tolerance",
48 cl::desc("Specify the \"test\" i.e. suspect back-end:"),
50 clEnumValN(RunLLI, "run-int", "Execute with the interpreter"),
51 clEnumValN(RunJIT, "run-jit", "Execute with JIT"),
52 clEnumValN(RunLLC, "run-llc", "Compile with LLC"),
53 clEnumValN(RunLLCIA, "run-llc-ia",
55 clEnumValN(CompileCustom, "compile-custom",
56 "Use -compile-command to define a command to "
58 clEnumValN(Custom, "run-custom",
59 "Use -exec-command to define a command to execute "
60 "the bitcode. Useful for cross-compilation.")),
64 cl::desc("Specify \"safe\" i.e. known-good backend:"),
65 cl::values(clEnumValN(AutoPick, "safe-auto", "Use best guess"),
66 clEnumValN(RunLLC, "safe-run-llc", "Compile with LLC"),
67 clEnumValN(Custom, "safe-run-custom",
68 "Use -exec-command to define a command to execute "
69 "the bitcode. Useful for cross-compilation.")),
73 "safe-path", cl::desc("Specify the path to the \"safe\" backend program"),
77 "append-exit-code",
86 AdditionalSOs("additional-so", cl::desc("Additional shared objects to load "
93 "compile-command", cl::init("llc"),
94 cl::desc("Command to compile the bitcode (use with -compile-custom) "
98 "exec-command", cl::init("simulate"),
99 cl::desc("Command to execute the bitcode (use with -run-custom) "
104 // Anything specified after the --args option are taken as arguments to the
111 OutputPrefix("output-prefix", cl::init("bugpoint"),
116 cl::list<std::string> ToolArgv("tool-args", cl::Positional,
120 cl::list<std::string> SafeToolArgv("safe-tool-args", cl::Positional,
121 cl::desc("<safe-tool arguments>..."),
127 cl::list<std::string> CCToolArgv("gcc-tool-args", cl::Positional,
128 cl::desc("<gcc-tool arguments>..."),
132 //===----------------------------------------------------------------------===//
136 /// initializeExecutionEnvironment - This method is used to set up the
211 // In "llc-safe" mode, default to using LLC as the "safe" backend.
214 SafeToolArgs.push_back("--relocation-model=pic");
224 SafeToolArgs.push_back("--relocation-model=pic");
234 Message = "Sorry, this back-end is not supported by bugpoint as the "
260 auto Temp =
261 sys::fs::TempFile::create(OutputPrefix + "-test-program-%%%%%%%.bc");
262 if (!Temp) {
264 << ": Error making unique filename: " << toString(Temp.takeError())
268 DiscardTemp Discard{*Temp};
269 if (writeProgramToFile(Temp->FD, M)) {
270 errs() << ToolName << ": Error emitting bitcode to file '" << Temp->TmpName
276 return Interpreter->compileProgram(Temp->TmpName, Timeout, MemoryLimit);
296 OutputPrefix + "-test-program-%%%%%%%.bc", UniqueFD, UniqueFilename);
317 OutputFile = OutputPrefix + "-execution-output-%%%%%%%";
334 Expected<int> RetVal = AI->ExecuteProgram(BitcodeFile, InputArgv, InputFile,
340 if (*RetVal == -1) {
348 " programs stuck in infinite loops gracefully. The -timeout "
352 " (with -timeout=0). This message is only displayed once.\n";
380 // Using the known-good backend.
382 SafeInterpreter->OutputCode(BitcodeFile, OutputFile);
387 if (Error E = cc->MakeSharedObject(OutputFile, *FT, SharedObjectFile,
411 " debug it (for example with the -run-jit bugpoint option,"
447 // Remove the generated output if there are no differences.