InitializeAllAsmParsers();
InitializeAllAsmPrinters();
InitializeAllDisassemblers();
- TargetOpts = InitTargetOptionsFromCodeGenFlags();
CodeGen = new LTOCodeGenerator();
- CodeGen->setTargetOptions(TargetOpts);
if (MAttrs.size()) {
std::string Attrs;
for (unsigned I = 0; I < MAttrs.size(); ++I) {
CodeGen->setAttr(Attrs.c_str());
}
+ // Pass through extra options to the code generator.
+ if (!options::extra.empty()) {
+ for (std::vector<std::string>::iterator it = options::extra.begin();
+ it != options::extra.end(); ++it) {
+ CodeGen->setCodeGenDebugOptions((*it).c_str());
+ }
+ }
+
+ CodeGen->parseCodeGenDebugOptions();
+ TargetOpts = InitTargetOptionsFromCodeGenFlags();
+ CodeGen->setTargetOptions(TargetOpts);
+
return LDPS_OK;
}
if (!options::mcpu.empty())
CodeGen->setCpu(options::mcpu.c_str());
- // Pass through extra options to the code generator.
- if (!options::extra.empty()) {
- for (std::vector<std::string>::iterator it = options::extra.begin();
- it != options::extra.end(); ++it) {
- CodeGen->setCodeGenDebugOptions((*it).c_str());
- }
- }
-
if (options::generate_bc_file != options::BC_NO) {
std::string path;
if (options::generate_bc_file == options::BC_ONLY)
path = options::bc_path;
else
path = output_name + ".bc";
- CodeGen->parseCodeGenDebugOptions();
std::string Error;
if (!CodeGen->writeMergedModules(path.c_str(), Error))
(*message)(LDPL_FATAL, "Failed to write the output file.");
std::string ObjPath;
{
const char *Temp;
- CodeGen->parseCodeGenDebugOptions();
std::string Error;
if (!CodeGen->compile_to_file(&Temp, /*DisableOpt*/ false, /*DisableInline*/
false, /*DisableGVNLoadPRE*/ false, Error))