32Error lto::DistributionDriver::emitJson() {
35 raw_fd_ostream OS(DistributorJsonFile, EC);
39 json::OStream JOS(OS);
42 JOS.attributeObject(
"common", [&]() {
43 JOS.attribute(
"linker_output", Params.LinkerOutputFile);
45 JOS.attributeArray(
"args", [&]() {
46 JOS.value(Params.RemoteCompiler);
49 if (!Params.RemoteCompilerPrependArgs.empty())
50 for (
auto &
A : Params.RemoteCompilerPrependArgs)
55 JOS.value(std::string(
"--target=") + Params.TargetTriple.str());
57 for (
const auto &
A : Params.CodegenOptions)
61 JOS.attribute(
"inputs",
Array(Params.CommonInputs));
65 JOS.attributeArray(
"jobs", [&]() {
66 for (
const auto &J : Jobs) {
73 SmallVector<StringRef, 1> Outputs;
76 JOS.attributeArray(
"args", [&]() {
77 JOS.value(J.ModuleID);
81 std::string(
"-fthinlto-index=" + J.SummaryIndexPath.str()));
85 JOS.value(J.NativeObjectPath);
93 JOS.attribute(
"inputs",
Array(Inputs));
95 JOS.attribute(
"outputs",
Array(Outputs));
105Error lto::DistributionDriver::saveJson() {
107 TimeTraceScope TimeScope(
"Emit DTLTO JSON");
114 BCError +
"failed to generate distributor JSON script: " +
120 AddToCleanup(DistributorJsonFile);
126 if (
Error E = saveJson())
129 TimeTraceScope TimeScope(
"Execute DTLTO distributor", Params.DistributorPath);
132 Args.push_back(DistributorJsonFile);
138 BCError +
"distributor execution failed" +
139 (!ErrMsg.empty() ?
": " + ErrMsg +
Twine(
".") :
Twine(
".")),
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file supports working with JSON data.
Provides a library for accessing information about this process and other processes on the operating ...
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
The TimeTraceScope is a helper class to call the begin and end functions of the time trace profiler.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Error operator()()
Invokes the distributor to compile bitcode modules remotely.
static LLVM_ABI Pid getProcessId()
Get the process's identifier.
LLVM_ABI StringRef stem(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get stem.
LLVM_ABI StringRef parent_path(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get parent path.
LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
LLVM_ABI int ExecuteAndWait(StringRef Program, ArrayRef< StringRef > Args, std::optional< ArrayRef< StringRef > > Env=std::nullopt, ArrayRef< std::optional< StringRef > > Redirects={}, unsigned SecondsToWait=0, unsigned MemoryLimit=0, std::string *ErrMsg=nullptr, bool *ExecutionFailed=nullptr, std::optional< ProcessStatistics > *ProcStat=nullptr, BitVector *AffinityMask=nullptr)
This function executes the program using the arguments provided.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
LLVM_ABI std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.
std::string itostr(int64_t X)