[clang] [llvm] [Clang-Repl] Introduce Error Recovery for Clang-Repl. (PR #223305)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 27 20:55:59 PST 2026


SahilPatidar wrote:

I integrated the changes locally and tested them. All the existing tests are passing.

Since the allocator changes were not accepted by the reviewer, we cannot merge that approach. Instead, I am using `IdentifyKnownObject`, which seems to work for our purpose. I allocate a few bytes before the start of each PTU and use the pointer to get an index through `IdentifyKnownObject`. This index acts as a checkpoint that we can later compare with other pointer indices. With the `IdentifyKnownObject`, all tests are passing as well. 

However, this approach does not work for custom slabs because `IdentifyKnownObject` returns a negative index for them. One possible solution is to allocate the full slab size (4096 bytes) each time to get a checkpoint index. Would that be okay?

I am also looking for another way to handle indexing for custom slabs.

And, I am creating a new PR with the restoration scope limited to specialization-related cases. Once I open it, I can further reduce the scope based on the feedback and suggestions.



https://github.com/llvm/llvm-project/pull/223305


More information about the cfe-commits mailing list