diff --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp index cc0979a8a17a..82e816dfe4b9 100644 --- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp @@ -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 machine( + target->createTargetMachine(targetTriple, "generic", "", {}, {})); llvmModule->setDataLayout(machine->createDataLayout()); llvmModule->setTargetTriple(targetTriple); return false;