Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/LTO/LTOCodeGenerator.cpp
Show First 20 Lines • Show All 592 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void LTOCodeGenerator::setCodeGenDebugOptions(ArrayRef<StringRef> Options) { | void LTOCodeGenerator::setCodeGenDebugOptions(ArrayRef<StringRef> Options) { | ||||
for (StringRef Option : Options) | for (StringRef Option : Options) | ||||
CodegenOptions.push_back(Option.str()); | CodegenOptions.push_back(Option.str()); | ||||
} | } | ||||
void LTOCodeGenerator::parseCodeGenDebugOptions() { | void LTOCodeGenerator::parseCodeGenDebugOptions() { | ||||
// if options were requested, set them | if (!CodegenOptions.empty()) | ||||
if (!CodegenOptions.empty()) { | llvm::parseCommandLineOptions(CodegenOptions); | ||||
} | |||||
void llvm::parseCommandLineOptions(std::vector<std::string> &Options) { | |||||
if (!Options.empty()) { | |||||
// ParseCommandLineOptions() expects argv[0] to be program name. | // ParseCommandLineOptions() expects argv[0] to be program name. | ||||
std::vector<const char *> CodegenArgv(1, "libLLVMLTO"); | std::vector<const char *> CodegenArgv(1, "libLLVMLTO"); | ||||
for (std::string &Arg : CodegenOptions) | for (std::string &Arg : Options) | ||||
CodegenArgv.push_back(Arg.c_str()); | CodegenArgv.push_back(Arg.c_str()); | ||||
cl::ParseCommandLineOptions(CodegenArgv.size(), CodegenArgv.data()); | cl::ParseCommandLineOptions(CodegenArgv.size(), CodegenArgv.data()); | ||||
} | } | ||||
} | } | ||||
void LTOCodeGenerator::DiagnosticHandler(const DiagnosticInfo &DI) { | void LTOCodeGenerator::DiagnosticHandler(const DiagnosticInfo &DI) { | ||||
// Map the LLVM internal diagnostic severity to the LTO diagnostic severity. | // Map the LLVM internal diagnostic severity to the LTO diagnostic severity. | ||||
lto_codegen_diagnostic_severity_t Severity; | lto_codegen_diagnostic_severity_t Severity; | ||||
switch (DI.getSeverity()) { | switch (DI.getSeverity()) { | ||||
case DS_Error: | case DS_Error: | ||||
Severity = LTO_DS_ERROR; | Severity = LTO_DS_ERROR; | ||||
break; | break; | ||||
case DS_Warning: | case DS_Warning: | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |