[LLDB] Fix assertion failure by removing `CopyType` in `std::coroutine_handle` pretty...
authorAdrian Vogelsgesang <avogelsgesang@salesforce.com>
Thu, 2 Feb 2023 01:39:27 +0000 (17:39 -0800)
committerAdrian Vogelsgesang <avogelsgesang@salesforce.com>
Wed, 8 Feb 2023 18:22:50 +0000 (10:22 -0800)
commit54d4a2550d3167d51a9d386d9823a06aca459531
tree0f0f4ac6a8651c2846615d09c6a095c39d36d0bc
parent604cc68b587d8b8a90bd1a0aecfbc7bd3021e926
[LLDB] Fix assertion failure by removing `CopyType` in `std::coroutine_handle` pretty printer

The pretty printer for `std::coroutine_handle` was running into
> Assertion failed: (target_ctx != source_ctx && "Can't import into itself")
from ClangASTImporter.h, line 270.

This commit fixes the issue by removing the `CopyType` call from the
pretty printer. While this call was necessary in the past, it seems to
be no longer required, at least all test cases are still passing. Maybe
something changed in the meantime around the handling of `TypesystemClang`
instances. I don't quite understand why `CopyType` was necessary earlier.

I am not sure how to add a regression test for this, though. It seems
the issue is already triggered by the exising `TestCoroutineHandle.py`,
but API tests seem to ignore all violations of `lldbassert` and still
report the test as "passed", even if assertions were triggered

Differential Revision: https://reviews.llvm.org/D143127
lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
lldb/source/Plugins/Language/CPlusPlus/Coroutines.h