From df5f5eba1c48c34186c4b90e8771dc3b66475e39 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 9 Sep 2020 23:45:48 -0700 Subject: [PATCH] Make sure to delete LLVM target machine. --- code/compiler/13/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/compiler/13/main.cpp b/code/compiler/13/main.cpp index de2946f..fa3aeec 100644 --- a/code/compiler/13/main.cpp +++ b/code/compiler/13/main.cpp @@ -93,9 +93,9 @@ void output_llvm(llvm_context& ctx, const std::string& filename) { std::string cpu = "generic"; std::string features = ""; llvm::TargetOptions options; - llvm::TargetMachine* targetMachine = - target->createTargetMachine(targetTriple, cpu, features, - options, llvm::Optional()); + std::unique_ptr targetMachine( + target->createTargetMachine(targetTriple, cpu, features, + options, llvm::Optional())); ctx.module.setDataLayout(targetMachine->createDataLayout()); ctx.module.setTargetTriple(targetTriple);