Skip to content

Commit ff658d9

Browse files
committed
---
yaml --- r: 2541 b: refs/heads/master c: 1ad58d4 h: refs/heads/master i: 2539: 81025be v: v3
1 parent 8bc2a0b commit ff658d9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: aaf41815b1bd9d9474307f0b7e1d553500a63ecc
2+
refs/heads/master: 1ad58d4dd6fb40e0833a094799717cc2b17fefc6

trunk/src/rustllvm/RustWrapper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extern "C" void LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
9090
std::string Err;
9191
const Target *TheTarget = TargetRegistry::lookupTarget(triple, Err);
9292
std::string FeaturesStr;
93-
TargetMachine &Target = *TheTarget->createTargetMachine(triple, FeaturesStr);
93+
TargetMachine *Target = TheTarget->createTargetMachine(triple, FeaturesStr);
9494
bool NoVerify = false;
9595
CodeGenOpt::Level OLvl = CodeGenOpt::Default;
9696
PassManager *PM = unwrap<PassManager>(PMR);
@@ -101,10 +101,11 @@ extern "C" void LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
101101
TargetMachine::CodeGenFileType FileType2 =
102102
static_cast<TargetMachine::CodeGenFileType>(FileType);
103103

104-
bool foo = Target.addPassesToEmitFile(*PM, FOS, FileType2, OLvl, NoVerify);
104+
bool foo = Target->addPassesToEmitFile(*PM, FOS, FileType2, OLvl, NoVerify);
105105
assert(!foo);
106106
(void)foo;
107107
PM->run(*unwrap(M));
108+
delete Target;
108109
}
109110

110111
extern "C" LLVMModuleRef LLVMRustParseBitcode(LLVMMemoryBufferRef MemBuf) {

0 commit comments

Comments
 (0)