[clang] [clang-rel] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-17 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89031 >From d396330fd004db50b3808e491cb45847888bb651 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Wed, 17 Apr 2024 07:12:40 + Subject: [PATCH] [clang-repl] Clone the llvm::Modules to avoid invalid

[clang] [clang-rel] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-17 Thread Vassil Vassilev via cfe-commits
@@ -73,7 +74,15 @@ llvm::Error IncrementalExecutor::addModule(PartialTranslationUnit ) { Jit->getMainJITDylib().createResourceTracker(); ResourceTrackers[] = RT; - return Jit->addIRModule(RT, {std::move(PTU.TheModule), TSCtx}); vgvassilev wrote:

[clang] [clang-rel] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vassil Vassilev (vgvassilev) Changes Clang's CodeGen is designed to work with a single llvm::Module. In many cases for convenience various CodeGen parts have a reference to the llvm::Module (TheModule or Module) which does not change

[clang] [clang-rel] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-17 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/89031 Clang's CodeGen is designed to work with a single llvm::Module. In many cases for convenience various CodeGen parts have a reference to the llvm::Module (TheModule or Module) which does not change when a new