Files
scriptc/native/llvm-codegen/src/emit.h
T

40 lines
1.4 KiB
C++

#pragma once
#include <optional>
#include <string>
#include <vector>
namespace scriptc {
struct EmitOptions {
std::string Input;
// One output per program partition; several require object output.
std::vector<std::string> Outputs;
std::string FileType = "obj";
std::string Target;
std::string OptLevel = "2";
std::string RelocationModel = "pic";
std::string DiagnosticFormat = "json";
std::string SourcePath;
// Runtime bitcode whose small functions are imported available_externally.
std::vector<std::string> ImportBitcode;
// Private directory for reusable partition artifacts; empty disables reuse.
std::string CacheDirectory;
// Instruments the program for IR profiling. The instrumented executable
// writes raw profiles to this path pattern (LLVM_PROFILE_FILE overrides it
// at run time). Empty: no instrumentation. With ProfileUse, the program is
// optimized by that profile and instrumented again after inlining, which
// records context-sensitive counts.
std::string ProfileGenerate;
// Indexed profile (.profdata) that guides optimization. Empty: none.
std::string ProfileUse;
// With several outputs: optimize the module whole and divide only its code
// generation among the outputs.
bool SplitCodegen = false;
};
std::optional<EmitOptions> parseEmitOptions(int Argc, char **Argv);
int emit(const EmitOptions &Options);
} // namespace scriptc