1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

LTO: Simplify ownership of LTOCodeGenerator::TargetMach.

llvm-svn: 245671
This commit is contained in:
Peter Collingbourne 2015-08-21 04:45:57 +00:00
parent 1a4134b22f
commit e7628d5684
2 changed files with 4 additions and 7 deletions

View File

@ -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;

View File

@ -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;
}