if (UseDiagnosticHandler)
CodeGen.setDiagnosticHandler(handleDiagnostics, nullptr);
- switch (RelocModel) {
- case Reloc::Static:
- CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_STATIC);
- break;
- case Reloc::PIC_:
- CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC);
- break;
- case Reloc::DynamicNoPIC:
- CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC);
- break;
- default:
- CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DEFAULT);
- }
+ CodeGen.setCodePICModel(RelocModel);
CodeGen.setDebugInfo(LTO_DEBUG_MODEL_DWARF);
CodeGen.setTargetOptions(Options);
// SetMergedModule is true.
if (SetMergedModule && i == BaseArg) {
// Transfer ownership to the code generator.
- CodeGen.setModule(Module.release());
+ CodeGen.setModule(std::move(Module));
} else if (!CodeGen.addModule(Module.get()))
return 1;
}