mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 23:18:51 +00:00
LTO: Simplify ownership of LTOCodeGenerator::TargetMach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245671 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ad3f32e4a5
commit
22df81e087
@ -159,7 +159,7 @@ private:
|
||||
std::unique_ptr<LLVMContext> OwnedContext;
|
||||
LLVMContext &Context;
|
||||
Linker IRLinker;
|
||||
TargetMachine *TargetMach = nullptr;
|
||||
std::unique_ptr<TargetMachine> TargetMach;
|
||||
bool EmitDwarfDebugInfo = false;
|
||||
bool ScopeRestrictionsDone = false;
|
||||
lto_codegen_model CodeModel = LTO_CODEGEN_PIC_MODEL_DEFAULT;
|
||||
|
@ -86,9 +86,6 @@ void LTOCodeGenerator::destroyMergedModule() {
|
||||
|
||||
LTOCodeGenerator::~LTOCodeGenerator() {
|
||||
destroyMergedModule();
|
||||
|
||||
delete TargetMach;
|
||||
TargetMach = nullptr;
|
||||
}
|
||||
|
||||
// Initialize LTO passes. Please keep this funciton in sync with
|
||||
@ -352,9 +349,9 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
|
||||
break;
|
||||
}
|
||||
|
||||
TargetMach = march->createTargetMachine(TripleStr, MCpu, FeatureStr, Options,
|
||||
RelocModel, CodeModel::Default,
|
||||
CGOptLevel);
|
||||
TargetMach.reset(march->createTargetMachine(TripleStr, MCpu, FeatureStr,
|
||||
Options, RelocModel,
|
||||
CodeModel::Default, CGOptLevel));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user