Skip to content

Commit

Permalink
Don't leak TargetMachine in ExecutionEngine::setupTargetTriple
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 268361054
  • Loading branch information
MLIR Team authored and tensorflower-gardener committed Sep 11, 2019
1 parent ee8cbcc commit d732aaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mlir/lib/ExecutionEngine/ExecutionEngine.cpp
Expand Up @@ -119,8 +119,8 @@ bool ExecutionEngine::setupTargetTriple(Module *llvmModule) {
errs() << "NO target: " << errorMessage << "\n";
return true;
}
auto machine =
target->createTargetMachine(targetTriple, "generic", "", {}, {});
std::unique_ptr<llvm::TargetMachine> machine(
target->createTargetMachine(targetTriple, "generic", "", {}, {}));
llvmModule->setDataLayout(machine->createDataLayout());
llvmModule->setTargetTriple(targetTriple);
return false;
Expand Down

0 comments on commit d732aaf

Please sign in to comment.