Browse Source

Make sure to delete LLVM target machine.

search
Danila Fedorin 2 years ago
parent
commit
df5f5eba1c
  1. 6
      code/compiler/13/main.cpp

6
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<llvm::Reloc::Model>());
std::unique_ptr<llvm::TargetMachine> targetMachine(
target->createTargetMachine(targetTriple, cpu, features,
options, llvm::Optional<llvm::Reloc::Model>()));
ctx.module.setDataLayout(targetMachine->createDataLayout());
ctx.module.setTargetTriple(targetTriple);

Loading…
Cancel
Save