From b805609986a25ebb8491a8fefc3357cf2f2865f9 Mon Sep 17 00:00:00 2001 From: Vsevolod Livinskiy Date: Wed, 8 Jul 2015 14:56:18 +0300 Subject: [PATCH] Fix for assembler file generation. --- module.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module.cpp b/module.cpp index 84a0d140..971b0bf4 100644 --- a/module.cpp +++ b/module.cpp @@ -1462,7 +1462,11 @@ Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, std::error_code error; #endif +#if ISPC_LLVM_VERSION <= ISPC_LLVM_3_6 llvm::tool_output_file *of = new llvm::tool_output_file(outFileName, error, flags); +#else // LLVM 3.7+ + std::unique_ptr of (new llvm::tool_output_file(outFileName, error, flags)); +#endif #if ISPC_LLVM_VERSION <= ISPC_LLVM_3_5 if (error.size()) { @@ -1506,9 +1510,9 @@ Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, // Success; tell tool_output_file to keep the final output file. of->keep(); } - +#if ISPC_LLVM_VERSION <= ISPC_LLVM_3_6 delete of; - +#endif // LLVM 3.7+ return true; }